Android :: Returning An XML File From Web Service To Device
Aug 10, 2010
I have a set of mp3 files on my computer which i want to be the server. Now i have a web service(Songs_Collection). This web service returns the list of all songs present on the server to the user.The user can download the desired file directly from the server.
I have a small problem :
How does my web service get the list of audio files kept on the server in the folder c:Audio Files.
Someone suggested that i need to keep the names in a "Web Content" folder, but can anyone suggest how should i approach it?
I worked out on this part . But now how do I send it to the client on device ?
Can i send it directly as an array? I guess then some seriliazation-deserialization needs to be done. Or If send it as an XML file then how should I proceed? (This is more important)
View 1 Replies
May 6, 2009
I've been researching how to best implement a service which performs a network transaction and returns data to the caller.
Clearly, this needs to happen on its own thread which means some form of async response. I can see at least three ways of doing this--some more complex than others. In the descriptions below, C is the caller, S is the service.
1) C wraps a Handler in a Messenger object, adds this to an Intent. C then calls startService with this intent. S extends IntentService which runs the Intents received in a worker thread. S then sends a message to C via the Messenger. This has the benefit of not requiring any of the async binding process or making an IDL interface that needs to be compiled into C. This seems to be the closes to a Handler-based response mechanism of Local Services.
2) C binds to S and then uses AsyncTask<> to make a blocking call to S. S performs the network transaction and returns the data in the return value or an out parameter. This requires the async binding process, but does not require a callback function since the inter- thread communications is handled by AsyncTask<> and the worker thread is in C's context.
3) Make the function called in S be completely asynchronous. S defines two interfaces: IMyService and IMyServiceCallback. S implements IMyService.Stub. C implements IMyServiceCallback.Stub. C binds to S then calls S via IMyService, passing its IMyServiceCallback binder. S spins up a worker thread and returns immediately. S then calls the callback when it has completed the network transaction.
I am asking for advice on which methods are most appropriate. I do not need the the service running constantly, only when the web transaction is required. C does not use S all the time--definitely don't want to bind during C's onCreate. However, I would like the time from when C determines it needs to use S to getting the results back to be as quick as possible (i.e. adding minimal latency to the already latent network access).
Is there any preference to having the worker thread in C or in S? Are there any significant problems with option 1?
View 11 Replies
View Related
Oct 11, 2010
The FileObserver class doesn't appear to be working as advertised.
I created a class extending the FileObserver class. I initialize the class to watch the path of the sdcard as returned from the Android Environment.getExternalStorageDirectory function. Everything seems to work perfectly as long as the files are in the ROOTof the sdcard. Any files within SUB-FOLDERS of the sdcard are NOT returned to my public void onEvent(int event, String path) callback in my FileObserver class.
The docs say files in subfolders should be returned to the onEvent() callback but it's not happening. Note, I've only tested on the Android simulator (v2.2) since I do not yet have access to a device. Maybe this is a bug specific to the simulator?
View 4 Replies
View Related
Oct 14, 2009
Does anyone know what this program is? What does it do? i launch it, it goes into preparing device and then I am back at home screen.
View 5 Replies
View Related
May 21, 2010
my application objective is to save location updates every ,let say, 20 minuets .I used service and it worked fine , but when i lock the screen or it is locked automatically the service stop running .when i unlock it , service runs again.How to make my code run all the time in all conditions?
View 1 Replies
View Related
Apr 28, 2009
I am looking to implement an Android service that will serve as the "driver/hardware access" for a device that will connect to the usb host port. Is there a good framework or example showing how I can make a service interact with this device? Its not a standard device that Android already supports other than the fact it connects via usb.
I am able to do this with linux libusb native code already but what would be the pathway to make this work through the android java framework?
I want to avoid having to make a kernel level driver for this that is why I prefer to have this implemented as a service for other apps to access the device.
View 3 Replies
View Related
Aug 3, 2010
i wonder what is the name of the service in ClientLogin for Android cloud to device, i found this link for all the service but i didnt find C2DM in it .
View 1 Replies
View Related
Nov 17, 2010
I am building an application in which i need to start a service when the time is 7pm.
View 1 Replies
View Related
Jul 21, 2010
I write a app but it is not doing anything..code is given below:
CODE:...............
View 3 Replies
View Related
Oct 12, 2010
How start my service when turn on my device in automatic mode ?
View 3 Replies
View Related
May 24, 2010
I have written a class which extends the Service class of android and would like to launch the service during device boot-up. From the service I would like to receive the intents such as boot completed and screen off and on. Currently I am using a BroadcastReceiver to get the boot completed intent and then on starting a service to receive screen on and off intents. But I would like to remove either the broadcast receiver or the service. Any inputs.
View 2 Replies
View Related
Jun 17, 2010
I've read the posts that state that there is no way to automatically start a service right after the package is installed. In my case, i have two apps- one runs as a service and collects data, the other displays it. the second app has the Activity which can be used to start the service. in order to provide the most accurate information, the service must be started immediately after installation. however, if the user decides not to run the activity immediately, then there would be a gap between the time the service is installed, versus when it gets started. of course, asking user to reboot after installation is one option, but not a great user experience. Any suggestions on how to achieve this?
View 4 Replies
View Related
Apr 1, 2010
I just launched my app VLC Remote and was surprised to see that there isn't a way to post a link to the app on the market that works both on my android device and also in my browser.
-so I made a way, and I'm opening it up for all-comers.
What it does is lets you post an http link like this
http://and-download.hobbyistsoftware.com/android/download?name=VLC Remote&q=pname:com.hobbyistsoftware.android.vlcremote
If someone clicks on the link from an android device, then the link opens in the market. If they click from their computer, then it offers to send them a link by email (so they can click on the link on their device).
the download emails have a (subtle) advert for my app, but the feature is clearly your app!
details are here:[url]
View 13 Replies
View Related
Sep 5, 2010
I have coded this service, that computes stuff and i want other applications to be able to bind this service, i.e. i want to enable other programmers to communicate with this service. problem is, this has to work without these other programmers to get access to the source code. just the (installed) apk with the remote service is given (and of course a detailed description of the service' interface)...problem is, eclipse keeps braggin' about that the packages of the service are not available in source code...
View 1 Replies
View Related
Mar 20, 2009
I have a background service component which is reacting to changes in network connectivity. I would like to alert the user that a a connectivity change event has occurred by popping up a Toast View on the device screen. Is this possible ? Can it be done even though a Service component does not have a UI associated with it ?
View 3 Replies
View Related
Jun 30, 2009
I'm looking for a protocol to secure a connection between a mobile device and a web service. I want to ensure that only the mobile device can perform actions on the web service and vice versa. Data doesn't need to be encrypted. I know Oauth, but it seems that it's more used to secure connections when you got 3 different entities (Server, Consumer and Auth). Here, the Consumer and the User would be the same person. Is there a simple protocol to do that (without requiring the user to login and then authorize the access token like it is the case for Oauth)? I need to use it on different plateforms, so the protocol needs to be available at least on iPhone and PHP.
View 3 Replies
View Related
Dec 5, 2009
I need test my Android app on a Motorola Cliq but don't have one. Is there a testing service that will let me make a debug connection to that device so I can run some tests and find out where the code is failing. Video connections won't tell me that.
View 2 Replies
View Related
Jul 9, 2010
I have created a service that works great, it is launched from an activity at the moment. I'm looking to package it into a .jar file so that other people can add the jar to then their projects and then run the service. Can anyone tell me how I can launch this service from the app that it is included in?
View 3 Replies
View Related
Apr 5, 2009
I'm getting some weird behavior when I try to open a file within a service:
CODE:...............
View 3 Replies
View Related
Jul 20, 2010
Does anyone have a good example of using a service to download a file?
I am not sure whether to use remote or local and even if I was sure, I need a basic example to start with.
Basically, I want to start the service with the url of the file to downland and when the download is done end the service.
Google's example of services is filled with junk so I am not sure what is needed and what is not.
View 1 Replies
View Related
Nov 14, 2010
When I download a file from web in android, then I want to show a progress bar in notification area of status bar through service, but I am not able to do this. How can i do it? I am not able to pass the file length in service. I am giving URL in EditText, and I am clicking Download Button. After Click A class will be called on Click Listener, this class is having a function. In that function I am doing processing or functionality of downloading, Now I want to show the progress bar in Notification Area Through service, but I can not able to do this.
View 2 Replies
View Related
Nov 25, 2009
Trying the 'Device Self Service 1.1' app to update my PRL (prefered roaming list) before I head out on a trip. I expect the 'udpate firmware' option not to work, but the 'update profile' and 'update prl' do not work. When trying to run either, I get a 'no service' error, even though I have 4 bars.
View 5 Replies
View Related
Jan 31, 2010
Tried to access it today and it was saying that i was entering the wrong pin. I know for a fact that it was right. Now i'm locked out of it and it says to call sprint to continue. I talked to them for about 45 minutes, they switched me over to HTC for another 30 and then back to sprint for another hour. They had me hard reset the phone twice and it didn't do anything. Was on the phone with advanced tech for the last hour and they finally said to wait 2 hours and it should reset itself. Well, it's now been about 5 and it still won't work... Any ideas on how to get it to work?
View 13 Replies
View Related
Jul 15, 2010
I took an android project and imported it in eclipse. in properties->android section it is showing platform 1.6 and API level 4. I have downloaded Android 2.2. Now when i try to make some changes in the source code and make an .apk file and try to install on my android device the device shows an error : Application not installed. the project is not showing any error but it is showing a warning : Attribute minSdkVersion (3) is lower than the project target API level (4) in manifest file. the person who gave me th eproject i asked him to mail his .apk file to me and that .apk file is running perfectly on the device.
View 1 Replies
View Related
Feb 24, 2010
I am trying to locate the database files on my nexus device.. is there anyway of doing it without rooting the device?
View 2 Replies
View Related
Jul 2, 2010
I have connected a device to PC which runs android OS. Once the device is attached I can see its direcotry F: .
How do I write a code in JAVA which can display me those files. I am using Eclipse IDE and Android plug in.
View 1 Replies
View Related
Sep 12, 2011
I bought a bionic and I want to give my og Droid to the kids and let them use it wifi only kinda like an iPod touch. Problem is is that when. I factory reset it (leaving it rooted) there is not a market and I cant get any apps so it makes it useless.
View 9 Replies
View Related
May 30, 2010
I have a Service that downloads a file from the internet. What I want is for the response (an InputStream in this case) to be handled by a custom handler that can be switched (like a strategy pattern) but I can't figure out how to do this. So basically the User of the API would be able to plug in different handlers for the response, some would parse XML, others might save files etc. I realise I could pass through the activity context and execute the method from this (given some interface) but I don't want to do this obviously, in case the Activity is closed in the meantime while the file is still downloaded.
UPDATE - I just had one idea it will work sort of but has problem if the DownloadRunnable gets changed between executions of the downloads.
The modified Runnable interface
interface DownloadRunnable {
void run(InputStream stream);
}
An enum
public enum ServiceHandler {.......................
View 1 Replies
View Related
Nov 8, 2010
I have a requirement to change network service permission(such as netd to 660 or something similar) for my application in order to access certain features. I dont want to edit init.rc file to make such changes. Since my application cannot be run in root mode, is there any alternative solution where i could do such modifications from my application point of view.
View 6 Replies
View Related
Sep 7, 2010
I'd love to get some ideas on best practices for testing our Android software, especially for AT&T devices. We're using a Samsung Captivate, on AT&T. As you know, AT&T disables sideloading (no Unknowns Sources option in Settings->Applications). We need to have our QA team load our apk file onto these devices as part of our testing and validation process. We're willing to install the SDK if needed, and upload the apk file via USB. We are not willing to root the phone.
View 2 Replies
View Related