IOS allows app to refresh it content even when it is sent to background. iOS can intelligently study the user’s behaviour and schedule background tasks to the moment right before routine usage. It is useful for app to retrieve the latest information from its server and display to user right when app is resumed to foreground. Examples are social media app (Facebook, Instagram & WhatsApp) and news app.
AlarmManager is a bridge between application and Android system alarm service. It can send a broadcast to your app (which can be completely terminated by user) at a scheduled time and your app can then perform any task accordingly.
With the help from
Intent, a bundle of information can also be sent together with the system broadcast to your application when alarm goes off.
However, since Android KitKat (API 19) and Android MarshMallow (API 23), Google has added different restrictions on
AlarmManager to reduce the battery usage. Alarm no longer goes off exactly at the assigned time by…
ViewPager2 is introduced in this year 2019 Google I/O and is a replacement of the old ViewPager, which was created in 2011. It includes some new features to enhance UI and coding experience, including:
NFC stands for “Near Field Communication”. Two electronic devices can transmit data through NFC when they are distanced fewer than 4 cm apart. NFC can be used for electronic payment. It was invented many years ago but it has just been introduced by Apple to iPhone series since the launch of iPhone7 in 2016. To test an app with NFC feature, a real device must be used instead of an iOS simulator.
To setup a NFC project, the “NFC Tag Reading” must be enabled in the “App Services” session during registering an App ID in the Apple Developer Console.
Google Sign-In is a famous feature in many modern mobile apps. It provides a neat and easy-to-use API for delegating the authorization procedures to the Google website and server. Google handles the security issues for app developers. Developers just need to follow 7 steps to implement the whole sign-in process.
An interesting trick was found during my last implementation — the
application(_:open:options:) function at the
AppDelegate is never triggered even it is a required setup stated in the official documentation. Why? Let’s see below.
UIPageControl is a control that displays a horizontal series of dots, each of which corresponds to a page in the app’s document or other data-model entity. It usually works with a
UIPageViewController or a paginating
UIScrollView. The default
UIPageControl only shows page indicator as white circles with different opacities.
UUIPageViewController is a common widget used in lots of modern apps today. It can display a series of individual UIViewController when the user swipes on it. A famous example is the app listing page in the App Store app:
Cloud Storage for Firebase is a great place for us to store users’ files. Uploading and downloading files to and from Cloud Storage is very simple and straightforward: Firebase provides a set of SDK for iOS, Android, Web, C++ and Unity developers to manage Cloud Storage for Firebase in an easy way. And it is easy for developers to restrict the access right to each file with Firebase Security Rules.
Below is a simple illustration of what we are going to build in this tutorial: