Android :: Marshalling Web Service Data To UI

Sep 14, 2010

I'm stuck on a tough architectural problem. I have a collection of web services that produce data that will populate UI components - Text Views, List Views, and so on. Each web service may take up to about 10 seconds to respond, or it might not respond at all. When I click a button in the UI that requires data from the web services I need to show a Progress Dialog until either the data arrives or it times out. I'm pretty sure that an Intent Service is the best way to wrap the web services. From the documents (http://developer.android.com/reference/ android/app/Intent Service.html) "This "work queue processor" pattern is commonly used to offload tasks from an application's main thread." Also "Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process."
The UI needs to get data back (asynchronously) from the Intent Service, which means using AIDL, onBind, and all that. But from the documents (http://developer.android.com/guide/developing/tools/aidl.html) we have "By default, IPC calls are synchronous. If you know that an IPC service takes more than a few milliseconds to complete, you should not call it in the Activity/View thread, because it might hang the application (Android might display an "Application is Not Responding" dialog). Try to call them in a separate thread." Of course, that "separate thread" stuff in the AIDL docs in nonsense. If you spawn a separate thread in an Activity it will get blown up in On Destroy. But what do they mean by "By default"? Are there cases where the IPC can be asynchronous? Is that what is meant by the text in the Intent Service docs "may not happen on the main thread"? How does this work?

Android :: Marshalling Web Service data to UI


Android :: Send Data Using CSD / Data Channel Of GSM Service?

Jul 28, 2010

I wanna develop an app that uses CSD or Data channel of GSM Service to send data. Can anyone help me out with it?

View 1 Replies View Related

Android :: Getting Data Back From Service?

Jan 12, 2010

I have created an activity that calls a service. This service receive an XML feed and parse the info. Each time I get the info for a new station i want to send the details (Name,Id,Location all as string) back to my main activity so it can load it inside a list view. When I run my code inside the main activity it works. When I move it to a service I cant send the data back. This is what I have tried. After getting the current station info from I do this: submit Station(namer, loc, ids, dis, types); then: private void submit Station(String names, String loca, String idss, String diss, String typess){Intent intent = new Intent(NEW_STATION_LISTING); intent.putExtra("Station Name",names); intent.putExtra("Sid", loca); intent.putExtra("StationLoc", idss); intent.putExtra("Distance", diss); intent.putExtra("Types", typess);send Broadcast(intent);}

View 3 Replies View Related

Android :: How Do I Get Data From A Running Service?

Aug 21, 2010

I have just started using services in Android and I have a made a simple service that is polling a server every 20 seconds. Now how can I get this data from my main activity (when it is active)? Alternatively the service could send it back do my main activity (but only if its active). I don't want to wake up my activity. I have read SDK examples of "Binding" but I can't find an example how to actually get something from the service. Just how to start and stop the Binding. From the example. If I have the "mBoundService" object in my activity how do I get my data from the service method called eg. "polling Data()"?

View 1 Replies View Related

Android :: Get Data From A Web Service In Droid App?

Oct 22, 2010

I am new in android development. I want to get data from a web service in android application.But the application is in html5. Now it uses the data from a local xml file.how it get data from a web service?

View 2 Replies View Related

Android :: Listener Service For Data Sources

May 20, 2009

I just want to develop a service which listens to the database and it should invoke an activity as soon as there is a change. I tried to implement Contacts listener by registering Content Observer but couldn't see the expected result. Kept log in on Change() method, observed that it is not getting called, any clue that where it might went wrong.

View 4 Replies View Related

Android :: Sending Data From Service To Activity

Sep 23, 2009

I am having issue for sending data from service to Activity through notification , I click a notification a activity get invoked but when i try to add some parameters through bundle i am not able to get the parameters in that called intent , I have gone through the link
http://stackoverflow.com/questions/1198558/how-to-send-parameters-from-a-notification-click-to-an-activity. but still no luck has any body occurred with the same issue.

View 1 Replies View Related

Android :: Passing Data Between Service And Activity

Sep 19, 2010

So I'm getting really confused on how to do this whole thing and I was hoping someone could break it down for me a little bit.I have a service that should always be running, and at certain times it needs to alert the user that a task is to be completed(probably through a notification bar icon). When the user accepts the task, the service needs to look into the local database, construct some non primitive objects, and give them to the activity that it just started.I have looked all over and gotten very confused as to a proper approach so I have a few questions to help me wrap my head around it.If an activity creates a local SQLite database can the service and activities of that application access that same database later?Does the service and activity need to be in the same or separate packages? I would think no but for some reason I remember seeing something about this elsewhere.

How would I do the data transmission from the service to the activity? I was thinking a content provider but it seems like there should be an easier way for the service to just hand off the data. Similar to an Intent but for non primitives.

View 2 Replies View Related

Android :: Sharing Data Between An Service And An Application

Jun 28, 2009

In order to share data between one of my own Android service and an application i am looking for the best way to do this. I have seen the shared memory drivers inside the GNU Linux kernel, but no Java api. Maybe the specific Google IPC Blinder cad be used for my need ?

View 10 Replies View Related

Android :: How To Get Data From Service In Widget Without Binding?

Nov 13, 2010

I am writing application that has service that provides real time data to subscribers via remote callback mechanism. Now I wanted to add a widget that visualizes essential part of this data but got error: "IntentReceiver components are not allowed to bind to services". So what's the right way to get data from that service?

View 1 Replies View Related

Android :: Best Way To Share Data Between Service S And Activity A?

Jun 17, 2010

I want to create an app that contains a Service S and an Activity A. The Service S is responsible for preprocessing, such as preparing the data shown on the UI of the Activity A, before the Activity A gets invoked.I want to be able to invoke the Service S from outside the package, say from another Android app's Activity class B, do the preprocessing, and then when the data is ready, invoke Activity A. What is the best way to share data between the Service S and Activity A?How can the external activity B communicate with the Service S to determine if it has completed with all its preprocessing, and the Activity A is ready to be invoked?

View 1 Replies View Related

Android :: Pass Data From Activity To Service Using An Intent

Jul 20, 2010

How do I get data within an Android Service that was passed from an invoking Activity?

View 1 Replies View Related

Android :: Intents In Queue - Send Data Via Web Service

Sep 29, 2010

Is it possible, with an IntentService, to send another intent to the IntentService from within the IntentService? For example, say my IntentService is processing an Intent which has it write a bunch of data to the database. During this time, several other Intents to write other data may [or may not] have been queued up in the IntentService. Suppose, after processing that Intent by writing the data to the application's database, I want to queue up another Intent to send that data via web service to "the cloud." Perhaps I want to queue this processing in another Intent because sending to the cloud is secondary. Is it possible? Would it cause any problems if the Intent being processed is the only Intent in the queue at the time the IntentService is trying to queue another Intent?

View 2 Replies View Related

Android :: Use Of Intents Used For Sending Data To Activity From Service

Feb 16, 2010

I am little confused with the use of intents used for sending data to activity from service. In my application I have to have startactivity from the service and have to pass data ,so that activity can utilize the data while launching.For this i have written the following code Intent intent = new Intent(Service.this,Activity.class); intent.putExtra("data", data); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.start Activity(); I assume that the data is passed to the activity and can be parsed on the oncreate function of the activity.Now the service running in the background has to pass data to the activity continously for UI updates.For this I have written the following codeIntent intent = new Intent(Service.this, Activity.class); intent.putExtra("Data", data); intent.setAction(Intent.ACTION_ATTACH_DATA); sendBroadcast(intent,null); (Do I need to broadcast the intent???) In activity I have done following things:- Implemented broadcast reciever:private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_ATTACH_DATA.equals(intent.getAction())) { Bundle extra = intent.getExtras(); float Data[] = extra.getFloatArray("Data"); update(Data);

View 4 Replies View Related

Android :: Protect Shared Data Between Service And Thread

Jun 23, 2010

I'm doing an application that requires that certain thread access data that's shared among it and another service.How can I protect these shared data form accessing in the same time is there anything in android for that or android has nothing to do with this as Java API's will do the job.

View 7 Replies View Related

Android :: How To Send Back Data From Thread To Service?

Aug 31, 2010

I have a service from which a start a new thread. This new thread will communicate with a TCP server using socket. What is the best way to send the data received from TCP server back to the service? Handlers or something else?

View 1 Replies View Related

Android :: Way To Send Data From Service To Widget On Phone?

Apr 28, 2010

I am writing a widget on Android 1.6 that shows the minutes that a person has used on the current month.
The way I have it setup is by having a service that listens to the state of the phone and when the phone is picked up, it starts the timer and when the person hangs up, ends a timer. I would like to send this variable(long duration) over to my appWidgetProvider so I could update the edit text on it.

View 1 Replies View Related

Android :: Parse Through Xml Data From Consumed Web Service Droid?

Oct 4, 2010

I have a web service, .asmx that when consumed gives a response in the form:

<lData>
<name>...</name>
<posx>..</posx>
<posy>...</posy>
</lData>

I use Ksoap2 to consume the web service in Android, and I see the response as a string anyType {lData=anyType{name=....;posx=....;posy=....;};}

So, I get the right data from my web service, but i don't know how to parse it correctly.
I want to find a way to iterate through the different nodes.

I have tried to use a SAXParser, but can't seem to understand what I should use instead of the url. In the tutotirals I have followed the link to a xml-file on a url, but my url is only part "finished" since i need to consume the web service first. code...

Is this above something I should use, but have another openStream?

View 1 Replies View Related

Android :: Sending Data Back And Forth Between Activity And Service Locally?

Aug 13, 2010

I am a bit new to Android. What I need to do is send data back and forth between an activity and a service locally. The information sent is sensitive and must not be able to be picked up by other apps. This excludes using broadcast and the onBind() function if I understand things correctly? So the activity needs to send some string parameters to the service. Also it somehow needs to tell the service which activity started it so the service can reply to the correct class since many different activities will use this service.

Once the service has fetched the information via a http request it is suppose to send that data (just a long string which will later be parsed) back to the activity that started it. How do I go about doing this? Using static variables/functions is not an option since again many actives will be using this service. Sure it would be possible to use a static array to hold the classes but that just seems ugly. It's only possible to send simple variables (not objects) via the intent? There must be a better way to do this.

View 1 Replies View Related

Android :: Remote Process - Service Fetches Data From Network

Sep 15, 2009

I needed to call a remote service. The service basically fetches data from the network. I am bind the connection once,and then I unbind the connection when the user is no more in that page. Everything works fine.Except that when I call the sa,e remote method for 17th time,it just does not call the service at all.It neither throws the DeadObjecti Exception. I have run out of ideas.Is there anything that I may be missing.

View 7 Replies View Related

Android :: Unable To Get Data From Activity To Service / How Intents Could Pass That?

Nov 24, 2010

I am pretty new to this but I was told I could get good help here. A friend and myself are playing around with creating Android apps (using ADT)

Here is how we are trying to make the program: in activity, user sets threshold values for the X and Y axis on accelerometer. When user hits button "Start", startService is invoked and starts TiltService.

TiltService is designed to run in the background always on the phone without user interaction. TiltService constantly compares the threshold with the accelerometer values and will vibrate if they are off.

My problem is I can't seem to get the putExtra() data correctly. I have overridden the onStartCommand in my service but I get the message "unreachable code" when I save the getExtras() to a bundle.

Here is the relevant code (I can post the whole thing, just do not want to clog up page) code...

I thought I understood the basic of how Intents could pass data, but I guess I don't. Is it obvious what I am missing?

View 2 Replies View Related

Android :: Alternatives For Pushing Data From Droid Service To An Activity?

Jun 30, 2010

I've a service that is receiving UDP data from the network. I want to push this data from the service to a UI activity.

One way to do it is using broadcast Intents. What is the performance overhead of sending broadcasts frequently from the service to the activities?

Are there any other alternatives for doing this?

View 1 Replies View Related

Android :: How To Pass Complex Data Structures Between Service And Remote Binder?

Feb 17, 2010

The object passing between an Android service and the remote binder is happening through serialization of the object. If the service needs to return a very large collection, it seems very inefficient to use this. What is the recommended way to deal with this?

View 1 Replies View Related

HTC Incredible :: No Data Service After Froyo

Aug 31, 2010

I updated to Froyo this morning.I noticed I wasn't getting any data service on my phone so I ran the *228 thing. Phone rebooted and problem was solved.Sort off.I turned the phone off at lunch 'cuz I wanted to see the awesome boot animation. When the phone turned back on, there was no data service. I've now found that if I do the *228 thing it fixes the problem, but only until I reboot again. I've gone into the wireless and network settings and Mobile Network is checked and stuck at turning on. Do I need to do a factory reset to fix this? I've got a back up with My Backup Pro so it's not a huge deal if I do.

View 2 Replies View Related

HTC EVO 4G :: Talking / Browsing Web / Use Data Service?

Jul 16, 2010

I am new to the android world. i was on att and using a iphone until a few days ago i just got fed up with att's shitty service, and got offered a evo 4g @ the sprint store and jumped on it. so this is my first time ever using a android phone. my question is, is it not possible to talk and browse the web or use the data service at the same time? on the iphone 3gs i could do this, and im sure it could be done on the iphone 4 (flop), but i cant seem to be able to do this on the evo 4g.

View 15 Replies View Related

Sony Ericsson :: Want To Use Xperia X10 With No Data Service

Sep 5, 2010

I found a used Xperia X10, I called the seller and he claims it is unlocked, and that ATT won't see it as a smart phone or whatever. I want the phone, but I want to make sure that ATT won't charge me randomly for data. So can I opt out of Data, or cancel data on the line if I get the phone. Is there a way I can get the phone, put in my SIM card and only use the calling and texting that I've been using currently on my Samsung Impression?

View 10 Replies View Related

Motorola Droid X :: Loss Of 3G Data Service

Aug 4, 2010

I did a factory reset 2 weeks ago, because when I uninstalled launcher pro, my dx went black. reboots did not help. Since that factory reset, everything has appeared to be fine though. I just read the big read stickied warning, and figured I better ask about the potential issue.

View 4 Replies View Related

List View Display Data From Web Service

Sep 24, 2012

I have two list view which is display data from the web service.

List 1 -- with different background
List 2 -- with different background

I have two ArrayAdapter<String> to handle the values. I have issue in the display. my xml file is structured as

<Linear Layout>
<ListView> </ListView>
<ListView> </ListView>
<Linear Layout>

its displays the two list items by dividing the screen into two equal parts and scrolls within the list individually.

I wanted the List 1 to be displayed fully and then followed by List 2 and also it should screen should be scroll not with in the list but full screen so that List 2 could be seen below.

i tired many ways but still the results are not fine.

View 3 Replies View Related

Android :: Activity Which Downloads Data In Background With Service - Doesn't Get Destroyed On Hitting Back Button

Nov 9, 2010

I need to develop an application with downloads the data at the background and update about the progress in the front.

I guess this can be achieved using services and activity and passing data in between the. But, what I need to do is even if I hit back button and then start the activity again. It should check if the service is running or not. If service is not running it should start one else it should display the data from running service.

Something like music player where music is played by a service at a background and activity displays the information. Even on browsing through other activities of the application or hitting back, state of the music player is maintained.

View 1 Replies View Related

HTC Droid Eris :: No Data Service During Voice / Text

Jun 19, 2010

Could be a coincidence, but it appears it started happening right after I did the PRL update (*228). I have voice and text, but no email/pandora/weather bug/market. All I get is 'network error...I have done another *228, rebooted several times and did a battery pull.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved