notify user when website has changed using c2dm in android - android

i want to make app that make a notification when breaking news has arrived to news website
during my search i found two ways to do that
1- using c2dm server & php & database
2- using timer that scan the website automaticly every time period i decide it
can any one help me by give me an example code for each method or a Tutorial for each method

I'm working on GCM as well. The first comment already told you the right way to solve your problem, but I wanna add something more is that This excellent tutorial
Read it, try to understand it. I think it is quite clear. Hope this help :)

C2DM is deprecated. You could use GCM instead. Go through this tutorial how to get started with it.
You can refer this too.

Related

i need to change topics in my app every day or every week automaticlly without the user updates the app

I have Christian Android App and there are 5 buttons in my app , I need to update the topics , news and Verses daily or weekly without let the user update the app , is there any way to do that ? I will be grateful if any one help me with tutorials , Please Guide Me THANKS
You can either prepare all possible buttons and choose which to display according to the current timestamp, or you need to build a web API that can provide you with the necessary data and is updatable independent from the app itself.
You must use webservice and SQL DB for this. If you want to add more information for user you just need to update your data base. And in each button tap you should call web api for getting the data.
For web service creation you can use retrofit.
Refer these links
http://www.vogella.com/tutorials/Retrofit/article.html
http://www.journaldev.com/13639/retrofit-android-example-tutorial
https://developer.android.com/training/basics/data-storage/databases.html
Perfect answer by Jacob you can also use cache along with the API call which expires after a specific period. So you don't have to force the user to go online every time he uses your app.
I would do this with notifications, you can have scripts that run weekly to change a topic... and on message receive you can update your topics based on the data coming from the "data-load" this is good because on top of that you can notify them "You have a new topic" or something like that.
There is a lot of resources to set up notifications, and if you are using android studio it is already built in.
https://firebase.google.com/docs/cloud-messaging/
Thanks all for helping me , i already solve my problem through Firebase Realtime Database Because of your posts , thanks again for your help
here is the tutorial https://www.youtube.com/watch?v=QETnC6SEwa0

Send Email from android Using Firebase

Can we send emails within android using firebase , i have tried several libraries like GmailBackground,BackgroundMail, custom method of Javax to send mail , but unable to send any email ,not even a simple one.
So I wonder if Firebase give such a feature , it would be great ?
Firebase Email Sending Blog post is showing empty is i think deleted , but why?
if you have any working source or tutorial to sent an email with attachment , it would be great , thanks
I've been researching this all day...
Option with third-party: SendGrid.com
There's actually a blog post by Tyson Bailey where he explains how he managed to get that done using SendGrid.com (monthly fee) here:
http://blog.onaclovtech.com/2014/07/emailster.html
It even includes the link to a Git he created upon it.
The solution in fact uses AngularJS as #Rexford mentioned in his comment.
Other options... None that I know for the moment, and am exactly researching upon a solution through GCP.
I can tell you they have been working since 2014 on something called "Triggers" that would allow triggering API actions from the database changes (which would helps lot), but seems to have been merged into Google Cloud Functions lately which is in Alpha by the time.
The good news is that as of a few days ago Firebase does now support sending emails... Obviously not from Android - that would be horrible - but from Firebase Fucntions - see here for an example.
Don't think Firebase support that yet..
You can use maligun service with this library for now. I have tested, it works.
https://github.com/sargue/mailgun
https://documentation.mailgun.com/en/latest/quickstart-sending.html#how-to-start-sending-email

sending information and getting response in android

In my app i need something like that.In my app a user can easily be a member by signing up.Now when a user become a member then he can communicate with other members.Suppose a want to send a message(same message) to all users, same location as he is.Or it may be something like that a user want to send a message(same message) to another 5 users whom he knows.
How can i do that.
I googled may times.I thought web-service can do that job.But i didn't right way to do that.
Can anyone how can i do that with references ???
You can refer following:
Simple PHP With MySQl(To get basics, No Interaction with Android)
http://davidwalsh.name/web-service-php-mysql-xml-json
One Demo:(Interaction with Android)
http://www.codeproject.com/Articles/267023/Send-and-receive-json-between-android-and-php
Good Tutorial:(Interaction with Android)
part1-http://guruparang.blogspot.in/2012/11/connect-android-and-mysql-via-php.html
part2-http://guruparang.blogspot.in/2012/12/connect-android-and-mysql-via-php.html
Best Tutorial (Here u can get All the idea):
http://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
Use parse.com
Download the sample app. The sample app works both locally in Android and on the server-side. It does the hardest part for you.
Just modify it to make it fit your needs.

extracting/sharing information

Im building an app that helps prevent patients from going missing or helps locate them ... im able to get co_ordinates and send them to the defined number via sms. because of time constraints im looking for help narrowing down what i should look into before attacking the next section. The question is there there a better way to go about sharing data between two apps on different devices rather than sms.
any tips on extracting information from messages would also be great ty.
I think push notifications may be the way forward for you, check out this write up from Google about how to implement them:
https://developers.google.com/android/c2dm/

Is there a way to track how many users open your app(hourly,daily,etc)?

So does anyone know if there is a program that will allow me to track how many times my app is opened daily?
I'm not looking to track the users behavior or anything, I just what stats on the average use of my app.
To know this you need to send information to a server somehow. On the device you would need some kind of library or code that posts this information. On the server you need some service that receives it.
There's a number of tools that let you do that. Analytics tools for example: http://code.google.com/mobile/analytics/docs/
If you don't want to use a pre-made tool you could simply use an HttpClient and you could make a simple Servlet on the server that dumps the use count into a database.
Tow more details:
1- Make sure you ask the user for permission the first time he runs your app. This could be problematic for him because of privacy and bandwith.
2- I would batch this and send it to the server once per day (midnight).
I hope this helps.
Emmanuel
If want something easy to implement, you can use http://www.localytics.com/ I've used it for a couple of apps and it works really well.

Categories

Resources