0

I have created Android application let me describe problem here. Home page When user click on Pray time it show the below screen enter image description here

[enter image description here][2] What i want if i update time or calender on website it will update automatically on app.

Kindly help me out with the possible solution

2 Answers2

0

What you seem to be looking for, are push notifications, Google's push notification API, Google's realtime database or some third party tool, like Pusher, for example.

Viorel
  • 337
  • 2
  • 12
  • kindly guide me to create web api for time & calender and insert in the Android studio – Kamran Stu Feb 17 '17 at 20:56
  • You can start off by [creating a database](https://console.firebase.google.com/?pli=1) and then [setting up a listener](https://firebase.google.com/docs/database/android/read-and-write#listen_for_value_events) in your app. You should consider looking through that documentation, it is very good. – Viorel Feb 17 '17 at 21:08
0

What you are asking to do is to synchronize your calendar between Android and your website. This answer is along similar lines and may help.

Essentially you need a way to communicate 1) the fact that there have been changes, and 2) a way to transfer the data. You want to communicate the fact that the calendar changed in a minimum of bytes, and do it often. So you could have some kind of checksum that every minute or 5 minutes, you go and ask for the new checksum, if it has changed, then request the calendar data via JSON or some other way.

An example interface for the service would be:

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path(value = "/calendar")
public class CalendarResource {

    @GET
    @Path("/{userid}")
    public Response getChecksum(@PathParam("userid") String userid) {
        String checksum = "test"; // do some calculation or fetched cached one
        return checksum;
    }

    @GET
    @Path("/{userid}")
    public Response getCalendar(@PathParam("userid") String userid) {
        String calendar = "test"; // do some calculation or fetched cached one
        return calendar;
    }
}

You can find dropwizard tutorials here and here

You can find how to call the service here

What you need to do is read the tutorials, build a simple version and then when you have troubles look for answers like the above or ask a new question and post your (almost) working code.

Community
  • 1
  • 1
hack_on
  • 2,532
  • 4
  • 26
  • 30
  • kindly guide me to create web api and insert in the Android studio – Kamran Stu Feb 17 '17 at 20:54
  • Having REST calls seems like a good idea, but I suspect these updates don't come very often, perhaps once a year, so it might try to refresh too often and therefore use unnecessary data. It would be better to have an event based update, something that can be easily achieved with Firebase realtime database API. – Viorel Feb 20 '17 at 08:01