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.
Location tracking is a popular app feature in the market. Many apps use users’ location to provide different kinds of information. For example, a coupon app can make use of the geofencing to provide different campaigns around the user’s location at real-time.
In order to ensure a good quality of app, developers should test their app with a set of simulated location points. Unlike Android, which can use third party app (e.g. MockGPS) to mimic user’s current location, iOS is restricted and developers have to create a GPX file.
The location simulation is very simple and only has 3 steps…
Sending emails is a common digital marketing technique. However, setting up your own SMTP server and maintaining its security can be a difficult task for many business parties. In addition, you have to make sure to keep your servers up-to-date to keep them secure and take a lot of other steps to prevent your emails from being classified as spam.
Firebase provides a simple to use extension — Trigger Email for handling email delivery. Developers just need to register for an SMTP service provider and create a document with specific fields (e.g.
Proximity sensor is a small component which can detect a short distance for around 10cm. In iPhone and iPad, this sensor is placed at the top of the screen. It is usually used for dimming the screen to preserve battery while user is answering a phone call. Developer can also detect the change of proximity state and customise the corresponding action.
Let’s get started!
Proximity sensor is a short-distance detection component. The maximum distance is approximately 5cm. Google provides
SensorManager to handle the operation between app and hardware sensors. Developer can use the distance information to provide a better UX, e.g. dimming the screen when user is answering a phone call.