简体   繁体   中英

Designing Android App - Best Practice?

I am an experienced Java developer but I am now developing a app in Android and I have design related question. Here is the scenario and the questions follow.

The app intends to collect some statistics from a remote service (the collection of statistics may take a few minutes to about an hour) and display the statics on the smartphone as a graph, or some hierarchy of widgets to enable drill-downs or it may capture additional data from the user to get more information from the remote service.

My questions:

  1. How do I capture the user app registration info? Is there a sample registration capture pattern that can be saved on the remote server.
  2. After a successful registration the user can request (by clicking a button) for statistics. I intend to call a POST method on the REST Java remote service as an async call. The service collects the data and notifies the user not sure how. Should the service push the data? or should it notify the user that the data is ready and the user process pulls the data?

Any help will be greatly appreciated.

Thanks in advance.

You can use the NotificationManager to display notifications.

You can use the AccountManager to retrieve account information, eg the user name, if your application has the permission. It is quite common to use the account (one of the accounts at least) to identify the user.

If the data takes an hour to download, you should just put a notification that it's done. This obviously must be done in a service, not an activity.

It entirely depends on how you want the login screen to look, and how your server accepts login data. How are we supposed to know how you save data to your server?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM