CoinRoad: How We Made a Custom Push Notification App in Android

Today I want to tell you about an interesting and, in a sense, a new way of interacting with the user - custom push notifications in Android. We used it as the basis of our CoinRoad mobile application for displaying charts and quotes of cryptocurrencies on exchanges in real time in the form of push notifications updated in the background, which continue to work even after the application is closed.





The main advantage of this approach is that every day we receive a bunch of notifications on our phone, which means we pay attention to them by lowering the curtain or seeing them on the lock screen. However, the lifespan of such pushes is extremely small, since a push is usually either swiped or more detailed information is opened in the application and is deleted anyway.





Of course, there are notifications that stay on all the time, such as the music player. But until now, such a mechanic has not yet been applied to display trading history from exchanges, when every minute counts and it is important to be aware of without constantly switching between different applications. Desktop widgets do not solve the problem - to get to the desktop, you must first minimize the active application.





Custom push notifications

Android has provided the ability to create your own custom push notifications for quite some time. This is done through RemoteViews , which, however, is limited in terms of support for items available for display by the following list:





Supported Views
  • AnalogClock





  • Button





  • Chronometer





  • ImageButton





  • ImageView





  • ProgressBar





  • TextClock





  • TextView









, View



, . , , ImageView



. , , 1mb : TransactionTooLargeException.





Parcel



, Binder



. , , .





500kb, , . , , . Canvas, .





, , .





WorkManager CoroutineWorker





WorkManager Service Doze mode ( ยซยป, Marshmallow ) BroadcastReceiver .





WorkManager 2.3.0-alpha02



. WorkManager , , . WorkManager Foreground Service



WorkRequest, . , , WorkManager.





, WorkManager alpha-, .





, CoroutineWorker'





setForeground(ForegroundInfo(..))







, , , . cancel NotificationManager' , :





"If the notification does not currently represent a Service#startForeground(int, Notification), it will be removed from the UI and live notification listeners will be informed so they can remove the notification from their UIs."





, , .





At the moment, the application has integrated two popular crypto-exchanges with a total number of trading pairs exceeding 1000. These are the Kraken and Hitbtc exchanges. In subsequent updates, the list of supported exchanges will be expanded by such well-known platforms as: Binance, Bitmex, Bitstamp, Kucoin, Poloniex, which will almost completely cover the basic needs of traders and make monitoring easier and more convenient than ever.









If we talk about our common goal and mission, we want to acquaint people with the world of cryptocurrencies, make the threshold for entering this topic as easy as possible and show everyone that it is convenient, useful and promising.





Download from Google Play








All Articles