Pattern Lock Login for Mobile App

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Pattern Lock Login for Mobile App
Medium
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Pattern Lock for Mobile App Login

Pattern lock — Android pattern, rarely seen in iOS (no system analog). Principle same as PIN: local unlock of storage without sending secret to server. But pattern has specific security problems to understand before implementing.

Problem of greasy residue

Oily finger traces remain on phone screen. Pattern of 9 points recovered visually from 1–2 meter distance under right lighting. Abraham et al. (2010) research showed: most users draw L-, Z-, or S-shaped patterns — 12 most popular patterns cover ~20% user base. Important context for client when choosing authentication method.

Pattern encoding

Standard 3×3 grid — 9 points with indices 0–8. Pattern — sequence of indices. Minimum length — 4 points (Android requirement). From 9 points with minimum 4, ~389,112 possible patterns — substantially less than 6-digit PIN (1,000,000 combinations).

Encode pattern to string of indices: [0,1,2,5,8]"01258". Use this string as input for key derivation — same PBKDF2 scheme as PIN. Never save pattern in plaintext.

Custom View implementation

On Android you can take com.github.itsxtt:pattern-lock or similar open-source libraries — basic line drawing logic. But in enterprise projects we write ourselves: full control over visuals, cryptography, and no dependency on unsupported library.

Jetpack Compose:

@Composable
fun PatternLockView(
    onPatternComplete: (List<Int>) -> Unit
) {
    val selectedDots = remember { mutableStateListOf<Int>() }
    var currentPosition by remember { mutableStateOf(Offset.Zero) }

    Canvas(
        modifier = Modifier
            .fillMaxSize()
            .pointerInput(Unit) {
                detectDragGestures(
                    onDragStart = { offset -> /* find nearest point */ },
                    onDrag = { change, _ ->
                        currentPosition = change.position
                        // add point if touch in radius
                    },
                    onDragEnd = {
                        if (selectedDots.size >= 4) onPatternComplete(selectedDots.toList())
                        selectedDots.clear()
                    }
                )
            }
    ) {
        // draw dots and lines between selectedDots + line to currentPosition
    }
}

Key details: each point visited only once; line crossing untouched point automatically adds it (standard Android Pattern Lock behavior); minimum touch distance to point — ~24dp.

Hide pattern 500–800ms after completion — lines disappear, dots remain. Prevents shoulder surfing.

iOS: custom implementation

iOS has no system Pattern Lock. Implement via SwiftUI Canvas + DragGesture. Logic same, adapt visual under iOS Human Interface Guidelines. Pattern less common on iOS — usually specific client request (e.g., kids apps or specialized enterprise tools).

Fallback and error counter

After 5 failed attempts — require full credential login. Counter in Keychain (iOS) or EncryptedSharedPreferences (Android). After successful login reset counter and offer to redraw pattern — important warn user old pattern reset.

When not to use

Pattern — weaker than PIN with equal symbols. For banking, medical data, or corporate access — recommend PIN 6+ digits with PBKDF2 or biometrics. Pattern appropriate in apps where convenience matters more than max security: trackers, organizers, kids apps.

Timeframe

Custom PatternLock implementation with correct cryptographic scheme on one platform — 5–8 business days. On both platforms — 10–14 days (with UX adaptation per OS).