android application design -


i have develop application have continuously collect gps, accelerometer data [esp. when user in motion i.e traveling, else can relaxed). have communicate web server , handle response sever. this(handling response ) part application should continuously poll.

based on response server have show ui user.

i not clear design.

do have create activity start service. should service ran separate thread(this runs in background).

i planning create 2 services. 1 service continuously collect gps data.

other service communicating web server[start timer/alarm manager] polling. can these 2 services communicate each other.

also after processing response frm server service should able start user interface show form. not clear how handle this.

also acquiring wakelock required if have collect gps data continuously.

please clarify.

thanks

you can use alarmmanager polling. need set interval. notice components application, service, activity contexts. can application context. way think communication android message/event intent. define custom intents. need give them custom name action. use intent filters. can point point messaging doing startservice, startactivity or can broadcast intent. recommend communicate via broadcasted intents. message routing handled using intent filters. starting form etc startactivity(intent) , intent contain using intent.getextras(). long can put in bundle can pass , display. answer question, use intents everything. use broadcasting , filtering communication , intents again start activity display.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -