How to set notifications badge over app icon - java

I created a messaging app, I want when some user send a message to another user then that user receives notifications badges over there app icon.
It should be work even app is closed or killed.
Thanks in advance.
I tried some libraries of GitHub but not working.

This is not a feature the of Android system. Device manufacturers (like Xiaomi you mentioned) or launcher developers (like Nova Launcher) can implement it and expose an api for app developers, but there is no standard for that, nor is it expected by the users to be there.

Related

Doubts related to Android wear development | Beginner

I have built a Java Spring Application. This application in the end after doing its work pushes data to a sqlite database.
Now the functionality that i want to add is: Once data is pushed into db, i want to send a custom notification on an app running on android wear. This custom notification should have a message and some options for user to respond to. Finally on seeing the notification on android wear the user should select one of the options and that should be stored in a database.
As i am new to android development, I cannot understand three things:
1. What kind of android application should i develop?
2. How can this android application receive some message or data from some other service (in my case java application)?
3. How to save user response to database?
Some guidance would be really appreciated.
Thanks
I will try to answer all your questions. If your current Java application is a web app, then you will end up building a mobile/wearable app that will communicate to this web app. If your current Java application is not a web app, you will either have to integrate its logic into the mobile/wearable app directly or turn it into a web app so it can communicate with the mobile/wearable app.
You will end up developing two Android apps, essentially. A mobile app for the mobile device and a wearable app that will communicate with the mobile app. This can all be done in Android Studio and in one project though, so it will basically be one application at the end of the day.
Like I mentioned above, you will have to either integrate that existing application's logic directly into your new Android mobile app, or turn your Spring app into a web app and host it on a server that your Android mobile app can call out to to get data.
Android has the concept of local databases and can actually use SQLite on the device. This is most likely how you would store the response from your service.

Is EMM what I'm looking for?

We have a Java based web application and an android app for our enterprise needs. We would like to remotely push the android app from the web application and we don't know how to achieve this. After searching in Google, I found Android EMM but did not understand what that is exactly as there were no other blogs or tutorials other than the Google site which was difficult for me to understand.
It is similar to MDM solution but do MDM servers have an app preinstalled in the devices so that the installed app manages the installation of other apps?
Can anybody tell how to remotely push the android app from my web application?
To remotely push an app to an Android device you need to manage this device, you cannot just push an app on anyone's device. To manage a device you need to set up this device as managed, which will require a factory reset.
If you want to pursue this approach you can try the Android Management API.
You can just upload .apk file to your server and provide a link to the user. This is a very simple solution but requires user to agree "install apk from third party sources". In this case, a user needs to agree with installing apk.
If you want to install apk without user agreement you need to activate Device Owner on Android (Fred mentioned in the comment this approach).

Sending notification to everyone running an application, Android

Set up:
I have a system which has multiple users. Each user will download my app onto their Android phone and use it. What I want is when any user performs a specific action (I have two in my app), I want to pop up a notification in all the other user phones.
A simple break down is like this:
Start app --> Navigate to the part where action is performed --> Perform the action --> Store the action the a DB --> Notify ALL USERS --> Pop up the same notification on all phones.
How would I go about this problem? Can anyone suggest ideas or links, cause I don't even have a clue on how to approach this.
If you are looking to send notification to all users, even if all the users are not actively using the application, then Puch Notification is a good approach.
Push notifications let your application notify a user of new messages
or events even when the user is not actively using your application.
On Android devices, when a device receives a push notification, your
application's icon and a message appear in the status bar. When the
user taps the notification, they are sent to your application.
Notifications can be broadcast to all users, such as for a marketing
campaign, or sent to just a subset of users, to give personalized
information.
Have a look at Android Google Cloud Messaging
Also I have found XMPP a good solution as described by this post.
You will find some good solutions here and here
Well, you will need a database on a server, and then you will need the app to constantly (or at intervals) query the database in the background for changes, and notify the user when it finds one. A system similar to how many apps give notifications is what I am getting at.

Android c2dm push notifications after app reinstall

I have the following question:
I've successfully implemented C2DM in my application. I'm registering to both google c2dm cloud and a custom server that "creates" notification contents. Everything is working fine.
My question is : what happens when i uninstall my app and then reinstall it on the same device? I've noticed that C2DM is sending me back the same app_key, so apparently there's no way to determine my app installation status change. And i keep on receiving old push notification (they're customized by user preferences in the app).
I won't be able to test with a google play published app until final release, so i would like to know if there's a chance that google itself could notify c2dm that the app was uninstalled on my device and force it to change my app_id at next restart.
Thanks in advance
Stefano
From what I understand in C2DM, you shouldn't depend on Google's registration ID by itself. They "promise" nothing - you might even get a new registration ID without a clear reason (might be their own vrsion upgrades, etc.).
If you want to follow installation - you should do it with your own server - create a unique identifier whenever the app asks for registration, and use it and not the Google's registration ID.
Regarding to Google Play - couldn't find a difference between published app and unpublished one - the behavior seems to be the same.
Hope this helps somehow.
Shushu

Pushing response from Server into Client in android?

i am developing an restaurant menu app in android for Samsung galaxy tab. On my app user will select the food item and user will place an order. The list of items to be served is dispatched to the server through SOAP service. Now as soon as the the order get placed from the kitchen i want to notify the user that an order has been dispatched.
What i got while searching is that i can use PUSH Technology i.e. C2DM Cloud to Device Messanging. But i had not got proper code to use this in my app. Can any one give me a proper implementation of C2DM in android?
There are many push technologies. Another option is to use XMPP, as it will work on Android.
You can check Smack and asmack for XMPP. The asmack project is an Android specific derivitive of Smack, although there are people using Smack directly as well.

Categories