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
-
1just read them from a Database that returns the things, and when you change the DataBase the app will show the contents – Ivan Jun 22 '17 at 13:20
-
You can use Firebase for that! They give you realtime database! – Phil90 Jun 22 '17 at 13:22
-
am very sorry , do you have tutorials of that ? am sorry am not very good developer i make this app through your helping tutorials – Bishoy Jun 22 '17 at 13:22
-
Use a background service with alarm manager and make calls in the service and u can update – Avinash Roy Jun 22 '17 at 13:23
-
@AppPhil , sir how can i use firebase to make that ? – Bishoy Jun 22 '17 at 13:28
-
@Bishoy have a look at the docs https://firebase.google.com/docs/database/android/start/ – Phil90 Jun 22 '17 at 13:30
-
@AppPhil Thanks sir i will see this , very grateful of that sir :) :) – Bishoy Jun 22 '17 at 13:32
5 Answers
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.

- 133
- 1
- 7
-
first thanks for your comment , please could u guide me with tutorials ? – Bishoy Jun 22 '17 at 13:25
-
possibly no tutorials,atleast u have to grab in parts from here n there and group all of them – Avinash Roy Jun 22 '17 at 13:26
-
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

- 1,886
- 1
- 16
- 29
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.

- 143
- 10
-
-
I can't really help you with web development but once you have done that part. You can use Volley library to access the API. It uses cache by default, you can also look at oleksandr_yefremov's answer https://stackoverflow.com/a/16852314/7358880 – Abhishek Tyagi Jun 22 '17 at 14:00
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.

- 82
- 1
- 7
-
I don't think that a push notification should be used to load data from a server / from firebase. But I think push notifications are good to inform the user about new data. When the app gets opened then, the new data should be loaded. – Phil90 Jun 22 '17 at 13:35
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

- 27
- 6