Detecting app version in wso2emm - java

In working with wso2emm, I've noticed a particular behavior that we'd like to change on our end. This is that when you issue a deploy to a set of devices, the server will send one json message informing the client of a new update to their software, and if anything goes wrong in the process of downloading the update, the json message is lost.
I've saved this on the client end so that we can catch errors and retry and resume downloads. My question is, since I'm unfamiliar with a lot of web development, where would one look to modify the logic for sending out messages to mobile clients?

If your are using LOCAL notification for android, server add the message of update/install software in an API.
When android pull from server, device read that message and marked it as read into database status. Then server remove that message from API queue.
If your are using LOCAL notification for android, you can take any of these approach to find out what really happening.
Approach 1:(little bit manually)
Change android side code for sending version of device apps into server and change server side code to display app version in deivce tab UI.
Then cross check that your app have latest version or backdated version. If it have backdated version, then send update to that device/s.
Approach 2:
Do not mark as read this update message when 1st read this by device from API message queue.
Update read status after successfully update/install new version.

Related

Mqtt Check if a client is online or offline

I am using mqtt and mosquito broker to build a simple instant chat for an android platform. Now I wanted to implement a condition where any client can check if another client is online.
I know about Last will and testament but I wanted a user to be detected offline only wen the application is inactive or the user is not currently using the app.
I actually dnt need any code, buh wanted an idea as to how to implement this and I would be much grateful.
You can do this without relying on MQTT internals which is much easier in my view. With this approach, you have much more control over what is going on:
The client can periodically send a message within another topic to inform the server of its availability. In case the server does not receive that message after a specified amount of time, it can assumed that it is offline.
The client can also send another message if the user logs out and inform the server a well.
If you insist on using MQTT internal structure, you may find this question useful:
How to Find Connected MQTT Client Details

GCM Push Delayed from Amazon SNS Server; immediate push from SNS Management Admin

My problem is that pushes coming from my local serve to SNS are not delivered to a device until a push is made from the SNS Management Console.
The push from my Java server to SNS using the Java API seem to be "stuck" until I create a test push in the console. When this is done, all messages I have sent from my server to the SNS get sent along in a batch.
I've setup an App using GCM in the SNS Management Console. Adding to it step by step to make sure everything appears correct. The GCM setup (Server API Key, etc) look correct.
I've created an App and it runs. Gets the RegId from Google. And the GcmIntents are setup correctly. I then create an Endpoint in the Management Console with the RegId. I can Publish to this endpoint and they appear on the device. Excellent.
In my Java server I'll programmatically create this Endpoint, send this to the SNS and then Publish to it. I receive a MessageId and it all looks good. But the message will not be delivered to the device. I can do this multiple times. Everything looks correct.
To test my sanity, I go back to the Management console and I can see that the Endpoint is created and is ready. I use the Publish button to send a test message ("asddsaasd") and it is sent to the device. But all my previous messages are also sent. It looks like they are stuck in a queue that is only processed until the Management Console Publish button is used.
I can see no differences between the messages sent from my server or from the Console (as received by the ADB). Setting different values for the parameters or removing from my Java server makes no difference.
What am I missing?
My Java server is nothing special. Grails/Groovy project with the "aws-sdk:1.7.4" being used. Nothing else.
Thanks in advance for any tips.

Regarding automatic Push Notification

I am using the Google-GCM service for pushing notifications to a mobile device & building this application in Java EE.
I'm perfectly able to push notifications to the mobile device. And from the client-end (mobile) I'm able to receive input(string).
Henceforth my conceptual question starts: When I'm receiving input from a mobile (let's say: "Hello, Server"), I'm trying to build an automated process on the server-side and in reply it will push a notification (let's say: "Hi client, I'm fine; How are you?") automatically.
I want to grab some idea to push the notification automatically whenever the mobile device is registered. How do I do it?
All realistic implementations of GCM include a stage where an app receives a RegID, and communicates the RegID back to the server, typically via an HTTP service, typically along with some other business specific data. The server would store the RegID, associating it with other data, and later use it to send messages.
Have you implemented automated the delivery of the GCM registration ID to the server yet? If so, in the same piece of code, you might as well push a notification back. If not, do put together some. Server-side implementation would depend on your server's platform, naturally.

Check File in the server is change or not

I am trying to make an app that connect to the server.
The app is used by some devices.
If one of the devices upload something to the server, I would like other devices receive the notification about the server has something new.
My question is, how to check the server is change or not? How often we must check the server?
I wonder how the Online Messaging work, because someone send something, we receive the message ASAP
Is the concept can be use with my app?
Sounds like you want to take advantage of Google Could Messaging or GCM for short.
http://developer.android.com/guide/google/gcm/index.html
This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly).
GCM is the standard for how your apps "talk" to your servers. Either for a message in it's entirety or just a message to go check the server because it's been updated.

Receive email notifications in android app

Im trying to make a simple app (just for learning sake) that will be able to send and receive emails from my own server. I don't have a problem sending emails from my app, my problem is:
How do you receive push notifications from the email server
Have the app check inbox, refresh the inbox list
I have tried searching for this, but have found nothing.
Thanks for your help
C2DM does push notifications, depending on your server. Search stackoverflow for it.
The app can check the inbox with whatever API is available to get the server's status. Even HTTP is possible.
The SampleSyncAdapter sample app is an example of using a sync adapter to regularly synchronize data between the server and the device, but you can use the same idea for download-only.

Categories

Resources