Receive email notifications in android app - java

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.

Related

Android: How to setup a connection between two mobile devcies (Wi-Fi or network)

I am developing a game app where I am using Facebook SDK login button to retrieve the friend list. I want to send an invite to challenge their peers on the app. So the app receives a request from someone that they want to be challenged.
I do not want to use the request Dialog that uses facebook notifications. I want my own app to receive the notification and notify the user for incoming challenge.
I did some research and I could use the NSD but unfortunately it only allows you to connect to people on the same network. I want to be able to connect to friends from far away. I heard you can use emails but I have not found any documentation.
If you can point me to the right direction I really appreciate it.
ok i suggest the below approach for what you are trying to achieve, use facebook sdk to get the user friend data, there will be an id and name in the response. you can use this facebook id to give people a unique id in your system. when people are wanting to challenge their friends you use their id from facebook friendlist and lookup in your system if these friends have registered/ install your application. if so you send a notification to them if not may be you suggest them to send them a email or sms with a uri to ask them to install the application. Try the Graph API Explorer to play around with the data you can get from the Graph API.

Android - How to notify the user one row is updated in data base

We developed a Hotel Menu Order project in android. Now We have created the project successfully. We are using java, Jax-rs for web service, Mysql for database and Rest for communication.
Now we want to add some more features in our app. When the customer conforms their order that order should show to kitchen and admin. When we google for some example we found one way. That is Google Cloud Messaging. But this is online sevice. We can not use this service.
Because we are using in offline services. We use one centralized server in the hotel and all the devices will connect with WiFi. There is no internet connection.
In this case how to notify the user a row is updated in Database. Please let us know how to achieve this.
Via SMS, what you can do is that you can send the sms to the devices using thrid party services like twilio, on client side i.e. device end you can get the sms broadcast validate the number and the sms content, read the content and update the application DB and the UI accordingly.
Or if one device has internet then what you can do is send GCM notification to that device, and from that device you can update the other devices through wifi direct. But wifi direct has some limitation, I think using SMS is a better option.
u can use Google Cloud Messenger services, by which google provide free message service to your client. http://hmkcode.com/android-google-cloud-messaging-tutorial/ this example will help u to understand better.

Create a basic network app

I have a little question about an android app with a function "remote" use via internet.
So I have these ideas:
Create a webservice using php on the server, and refresh the client app all x time like 4-5 sec
Or make a java server (so I don't know how I can do that)
I just want make a remote connected via user/password to the server and the other app connect to the server and refresh his status.
Do you know the best way for do that?
Thanks
The question is not very precise, but as far as I understand it, both your ideas implement the 'pull' concept, that is the client app checking the status of the server every now and then.
If you want the app to be instantly notified of the server status change, I would suggest push notifications with GCM (Google Clound Messaging). You can find some basic descriptions and examples at: http://developer.android.com/google/gcm/index.html
Sending a server-to-client notification is simple regardless of the platform you use server side. E.g. for PHP integration with GCM, check out this thread: GCM with PHP (Google Cloud Messaging)

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.

capture outgoing packet sent by google chat in my application

I am familiar in using xmpp library,for android i'm using asmack library.In Google chat also asmack is used.i can write an application to send/receive messages using xmpp.But now i want to track google chat messages in my application.what ever the user do in google chat the same sholud be happening in my application.Suppose that user logged in google chat,in my appication also he is logged in.Sent messages /Incomming messages also should be in sync.i m able to do every thing except synchronizing outgoing sms.How to capture the packet when user is send a message from google chat into my application. ?
You should not be able to do that (unless rooted) as it would be security issue - anyone could sniff your any network activity that way. If your app sign in to the google talk server (as any other client) then you should receive copies of all the conversations, but that's it.

Categories

Resources