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
Feb 24, 2010
The code I am trying to implement includes a service and an application. When the application is first launched, it starts the service using the
startService(svc_name) call. Here svc name is an intent pointing to the class that runs the service.
I want to share a resource(file/socket connection) between the service and the application. For example one writes to a file and another reads from it. I am unable to get proper sync between the service and app. Could you please let me know how this can be achieved?
View 3 Replies
View Related
Apr 7, 2010
I was playing a bit with adapters cursors and activities. Let's assume i have a cursor containing a query I've made (it doesn't matter if it's to DB or content provider). Now lets assume i bind some of the data (first two rows) to a list activity. Every click on one of those items should open a new list activity (i pass on the cursor index in the activity bundle). Now the question is, which sharing method will be most efficient and right from code point of view ?
1. I thought of trying to send the cursor object in the intent itself (hoping it implemented runnable) but I'm not so sure it's that efficient since the query may contain many rows which will need to be parceled, and i the other intents uses only a few (say 4-5 columns of each row) it's a real waste.
2. Thought of trying to create the array list for my other list screen adapter and serialize it to the intent (again use serialize and intent to pass on the data) but again i fear for efficiency penalty.
3. my last solution was to use static cursor member in my first activity, with package permission, it will work and be relatively efficient, but I'm not so sure regarding memory efficiency and code structure, i'm not fond of using static variables in any case.
Is there another sharing method that i don't know off, if two activities share the same process and application, then they also share memory space, then it should be easy to pass variables from one to another, the question is what's the easiest way without serializing ?
View 6 Replies
View Related
Aug 10, 2010
I did some digging, but couldn't find a clear answer. I have an application with TabActivity as the main activity. I have some computing and network communication that needs to be done when user clicks on the big red jolly "DO IT" button. One tab hosts the form with "DO IT" button, while the other tabs display the results from computing (each tab displays different part of results). The computing is done as AsyncTask as it's supposed to be (afaik).
Now the question is, what is the best way to share the results between the tabbed activities? It can be done with ContentProvider + database from what I have read, although that seems like a bit too much for my needs. I have also considered an option to save the results to some cache file activities could read in onCreate, onResume etc and display the data. Are there any other convenient ways to share the data? (To make it more clear, the data aren't simple, so doing it through preferences etc is impossible.)
View 5 Replies
View Related
Mar 13, 2009
I was looking out for ways to share data between various activities that one may need to create for his applications . Using "Parcel" and Bundle one can do data exchange , but looks like this is a bit cumbersome process specifically if you have to share large array objects with too many fields.
As android.app.Application maintains global state for the application , we can use this class to store global data and access it across activities. Is this a good way ? Are there any implications on allocating large objects in the your class which extends from android.app.Application ?
View 6 Replies
View Related
Aug 25, 2010
I'm writing a game that includes an editor for users to create their own levels. I'd like players to be able to share the levels they've created with other players. I'm trying to figure out the best way of implementing that, and hoping for any advice on the subject.
One obvious option is to set up a server for sharing levels. The game would connect directly to the server to let players share their creations or download levels created by other players. This provides seamless integration and a good user experience, but I'd really prefer not to use this approach. For one thing, I don't want the cost and responsibility of setting up and maintaining the server. And I would be taking on a basically unlimited obligation; otherwise, if I decided to shut down the server a few years from now, the game would suddenly lose a large part of its value.
Another idea I had is to use the Android Market as the way to distribute sets of levels. That way, Google is taking care of running the server for me. Clearly there are programs that work this way, since I've seen lots of themes and expansion packs for particular applications in the Market. While this could work, I'm not very happy with it. Asking an ordinary user to sign up for a developer account on the Market and learn how to post files through it is unreasonable, not to mention they would have to pay $25.
The approach I'm currently leaning toward is allowing levels to be exported as ordinary files. People could then just email them to each other, post them on any website they wanted, etc. Ideally I would want to set up a file type association so they could simply open an email attachment or click a link in the web browser, and my game would automatically be launched to import it. I haven't yet looked into whether that's possible.
View 3 Replies
View Related
Jul 21, 2010
I am getting some glitches while making a tab enabled application.
I want to share data, between two tabs of mine application.
How can i achieve the same.
View 3 Replies
View Related
Oct 20, 2010
I am new in android development. i was wondering if i could share some data between two applications in android. One way is to place the text file on SD Card but i dont want to do this.Second way is to place in data folder, and i dont know how to.3rd way is to place the data in shared memory so both applications can see it.also i dont want the user to see or delete this file,only my two applications can change this file or data.Please help me.I've been wondering on this for 2 days.
View 5 Replies
View Related
Aug 23, 2010
I am working on a small android project where it is necessary to share some data amongst several activities and a service that runs in a separate process. I would just like to know what are my options in terms of sharing data? Application class? IPC? File-based? Broadcasts?
View 3 Replies
View Related
Sep 30, 2010
BBC News - Google Android apps found to be sharing data
Quote:
View 26 Replies
View Related
Aug 22, 2010
I'm looking for suggestions for ways to share Android app data between phones running the same app. For example, lets say I have an app that stores a database of book reviews. If person A has a book review that person B doesn't have, what are the options for getting that information from person A's phone to person B's phone?
Currently, I'm aware of the following options:
- Upload data from person A's phone to a server, then download data from server to Person B's phone.
- Write code to have the phones sync up using bluetooth
- Write code to send SMS messages
I'm wondering if there are any more options besides these, and if there's actually a best-practice for accomplishing this?
Ideally, I want the users to simply click a button in the app to make the sharing take place, so I don't want to go down the bluetooth route because that requires the user to do a bit of setup (or assumes they already have set things up in the form of bluetooth settings).
Since the data can be of variable length and potentially large, I believe that would rule out text messaging.
As far as the server route goes, from what I understand this seems to be an ok way of doing things, but my problem is that I have no experience with having users potentially sign in to a server and then uploading data. I don't know of the cost concerns (if any), or of potential security concerns (allowing just anyone to upload data, I'm not sure if I would have to take steps to ensure someone couldn't bypass the app and upload malicious data).
View 3 Replies
View Related
Jul 22, 2009
I have been using SharedPreferences to share data between activities. But I would very much like to find a better way. I would simply like both Activity1 and Activity2 to share Object1. Activity1 will create Object1 and then start Activity2. What is the smartest way to give Activity2 a pointer to Object1?
To summarize: Activities don't have constructors! How do I send data to them from their parent activity?
View 17 Replies
View Related
Jun 5, 2010
Has anyone tried sharing a wifi connection through the evo? I have a really old laptop without a wireless card and would like to be able to pick up wifi signal from my router with evo and use usb to share with my pc. Haven't tried yet and will when i get home bit just wondering if anyone had tried this or knows if it'll work.
View 3 Replies
View Related
Apr 5, 2009
I noticed an app on the market a couple of weeks ago that allowed you to share files with your PC wirelessly but can't find it now. Any idea what it's called? It's a paid app.
View 8 Replies
View Related
Nov 8, 2010
There are many file sharing apps in market.
Which do you like or recommend for private file sharing over the internet?
View 8 Replies
View Related
Mar 4, 2010
I'm making an Android Java app game (although this question applies to all languages really) and hope to release the first version soon. I'm nervous about how I save data in my game. My problem is that, if in a later update, I decide to store more data or store the same data in a different way, I need to be careful I don't lose or corrupt data for users that upgrade (i.e. I want users to be able to use data created by an old version in the new version, like their high scores from before).For example, say I want to save high scores in version 1.
View 3 Replies
View Related
Sep 3, 2010
I plan the weekend trip. My friend ask me to share the photo while trip. I can take the picture with my smartphone, and 3G internet connection is available on my phone. Is there a photo sharing application?
View 4 Replies
View Related
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
Sep 30, 2010
Come one, come all -- let's gather and act shocked, shall we? It's no secret that Google's Android Market is far easier to penetrate than Apple's App Store, which is most definitely a double-edged sword. On one hand, you aren't stuck waiting a lifetime for Apple to approve a perfectly sound app; on the other, you may end up accidentally downloading some Nazi themes that scar you for life. A curious team of scientists from Intel Labs, Penn State and Duke University recently utilized a so-called TaintDroid extension in order to log and monitor the actions of 30 Android apps -- 30 that were picked from the 358 most popular. Their findings? That half of their sample (15, if you're rusty in the math department) shared location information and / or other unique identifiers (IMEI numbers, phone numbers, SIM numbers, etc.) with advertisers. Making matters worse, those 15 didn't actually inform end-users that data was being shared, and some of 'em beamed out information while applications were dormant. Unfortunately for us all, the researchers didn't bother to rat out the 15 evil apps mentioned here, so good luck resting easy knowing that your library of popular apps could be spying on you right now.
Update: A Google spokesperson pinged up with an official response to the study, and you can peek it after the break.Update 2: Looks as if the full study (PDF) has been outed, with the 30 total apps named. Here they are: The Weather Channel, Cestos, Solitaire, Movies, Babble, Manga Browser, Bump, Wertago, Antivirus, ABC - Animals, Traffic Jam, Hearts, Blackjack, Horoscope, 3001 Wisdom Quotes Lite, Yellow Pages, Dastelefonbuch, Astrid, BBC News Live Stream, Ringtones, Layer, Knocking, Barcode Scanner, Coupons, Trapster, Spongebob Slide, ProBasketBall, MySpace, ixMAT, and Evernote.
View 6 Replies
View Related
Nov 17, 2010
I have a Desire and can't live without my swype for typing. My brother also has a Desire but hasn't got swype and the beta is closed. He wants to try and get swype onto his HTC by downloading mine. If he does this, will Swype allow it to be downloaded onto two phones or will they stop it?
View 8 Replies
View Related
Jun 8, 2010
the gmail app on the DINC does not support video and pic sharing? m I missing something here. When you take a vid and go to share, gmail comes up as one of your options. If you proceed down this route, you don't get an error, but the vid never gets attached and delivered. The only way to do this is through the HTC Mail app. On this same note, another gripe I have is why Android lists the sharing options if you can't actually use them to share. You can't share a video over Handcent/Messaging Apps...so why show them as options for sharing? You can't upload to facebook directly, so why list them as an option. Seems like a glaring issue that will confuse newbies (my wife) and may ultimately affect their adoption of the platform. I'm all for the customization and openness of Android, but they need to work out these little quirks if they want to capture any respectable market share.
View 1 Replies
View Related
Jan 22, 2010
I just switched over from the BB Tours and we used the BBM groups a lot, we used it to share lists (shopping, movies, etc). Is there any app out there that we can use to share lists again?
View 3 Replies
View Related
Sep 19, 2012
I have my Google account also setup on my wife's phone so we can share purchased apps. However, everything else is shared too. For example, even though I have sync for everything on my account turned off, my calendar still showed up on my wife's phone until I disabled it in the calendar app. Also, I can't remove my Google Talk account from her phone so my messages show up on her phone.
This is on a pair of stock Samsung Galaxy S3 phones.
View 2 Replies
View Related
Apr 30, 2009
This app allows you share file from android phone with any users my sms/email/link.
How it works:
1. Upload file to server.
2. Get link for file and send its by sms or email from application.
This is just beta. I am looking for any proposals and feedbacks. Download Send big files the easy way. Files too large for email attachments?
Current limitations: 50MB per user and 10MB per file. Also, because the server is running in test mode, files and accounts may be lost.
View 1 Replies
View Related
Oct 15, 2010
What's everyone's favorite photo sharing program and does it have an Android app? I'm looking to move away from picasa since it strips a lot of EXIF data on upload.
View 5 Replies
View Related
Oct 30, 2010
I've got an app that accepts images from the image gallery (via share menu). My app starts, and I do this:
Bundle bundle = getIntent().getExtras();
Object obj = bundle.get("android.intent.extra.STREAM");
While debugging, Eclipse is reporting the object obj is of type 'Uri@StringUri' (???) and inside it somewhere is the string 'content:
//media/external/images/media/992'.
Anybody know what type of object obj is so I can typecast it? And what's the string about? IE, how do I get to the image data?
View 1 Replies
View Related
Jun 23, 2010
to start with I've gone through the entire notepad tutorial, I'm a professional game programmer who has some extra time. (though most of my time has been in C++, I did take a year or two of Java classes in college, and remember some of it). I'm not sure the site is a good site to ask questions like this.. If someone has a Forum that might be a good place to ask these newbie questions, please feel free to point me in the direction. I've examined a few of the samples, and think I've a grasp of what I want to do. I've a three to four project plan for some Android releases to sharpen my skills, but since this is my first project and I have never really developed for a mobile phone or the android before, I'd like to make sure I have a solid plan.The first project is an example of the license plate game, however I want to do a few things to change it. Heck maybe when I'm done it'll become a bingo style game, with bluetooth connectivity, you never know. The base idea is I want to offer a list of states, with checkboxes next to them. so to do this, I'll be starting with a Linear List layout similar to the note pad example, and then have a row that is only a Checkbox. I can use text and call strike through if it's been checked off. Perhaps offer an option to not show them if they are checked.
But I want the list to be generated from a set of lists. Maybe all of America's states, maybe reasonable American states (no Hawaii, no Alaska) maybe a North American list, (add in Mexico and some Canadian provinces), a European list, who knows. I'd probably have to have a pop up window that lists all of the lists I suppose using a radiogroup of some sort. So then as far as the data, after weighing options I think best solution is to make a database with two fields, "checked" and "name".I figure I can use the menu for most of the user interaction (aside from clicking on stuff we want to check off) with maybe a few context menu items, I understand how to make all of those already so I should be good. The question I have is what is the best way to populate the lists? Should I create raw data, and have different files for all the lists? Or is there some other way to do this? I've seen this done on the searchable dictionary, but I'd like to hear what people who have actually generated the data like this before. In addition is there an easy way to look at the sql database these applications create, or do you have to run searches on them and output the data? Finally any other suggestion or advice? I definitely want to try to get something like this on the market so I can see the full life cycle and see if anyone actually likes it. (luckily there's not a plethora of them already) but I also want a few people to look over my code if they're willing when I'm done to make sure I've done this right or at least not missing any basic mistakes.
View 2 Replies
View Related
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?
View 8 Replies
View Related
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
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