How to share data between 2 android applications - android

I am developing 2 application of android parallaly.Now i want to access one application data from another application i.e the data from folder data/data/com.sampleApp1.As both application will be developed by me so is it possible to access data of one application from another application if possible please provide solutions.Thanks in advance

If you're developing both applications you can use Shared User Ids. Both application will share permissions and files. Please be careful and check if you need/want this.
http://developer.android.com/guide/topics/security/permissions.html#userid
An another option would be a ContentProvider.

Please Refer Standard Content Providers Training Tutorial from developer.android
Please go through once you will not face any problem in future regarding Content provider
http://developer.android.com/guide/topics/providers/content-providers.html

I dont know how to access different folder and whether it is possible or not. I think the best idea for you is to use content provider.
Check this site:
http://www.vogella.com/articles/AndroidSQLite/article.html

Related

How To Get Data From 3rd Party App Like - Whatsdog Take From Whatsapp?

I'm working on an android app, and I wanted to make one like whatsdog, just for the knowledge.
Does anyone know what kind of API or SDK whatsdog uses to give a notification as soon as any of my contacts come online?
I searched a lot but got no answer so I thought I would ask here!
Any help will be appreciated!
Whatsdog may have taken permission from whatsapp officially for this purpose !
You can receive data via content provider . or if the third party app provide sdk or api , that will be another option .
Thanks

Modify the source code of contacts application on an Android

I want to know if it's possible to customize the default contact application because I want to write a better one. One that gives a ranking of the contacts in a particular user context (based on location, time, day, recent calls...). I want to give a list of 10 contacts which will probably be called. I've read that some internal classes in the application are not public and not in the SDK API's. So is there another way? I also started to write my own application and it's easy to get the contacts and make the design. But is it possible to make calls in it?
Thx in advance!
Yes, technically it is possible to modify the Contacts application, but it requires you to download the source. All of the source to the original Contacts application is on the documentation web site. Download the source, find the application and modify what you desire to modify. To address your issue about some of the class not being public, I'm sure you can figure it out. I can't imagine the functionality from those classes would be too hard to reproduce (unless they are core classes).

Android Content Provider and App in One APK?

I am creating an Android app that will get data from the Internet. Eventually I will want to change the app to get similar data from a different (yet to be determined) Internet location. Then even later, yet another location. I'd like to avoid changing my app to account for different Internet locations because that would be difficult to maintain.
There's probably a lot of options, but after some research it seems like a Content Provider may do what I want. It looks like Content Providers were designed to expose data across application boundaries. This is okay, but I don't care that the Content Provider is in a different app from my main app. No other app would be interested in my Content Provider's data, so crossing application boundaries isn't helpful in this case.
Is a Content Provider a good way to approach the problem?
Is there another option I'm not considering?
If a Content Provider is a good solution, how would I go about packaging both the app and the Content Provider(s) into a single .apk file?
Can this be done inside Eclipse or do I need to use the command line tools?
Content provider is a good solution for your problem.
You just have to declare your content provider in your manifest and it's build with your apk. If you don't declare your Content provider as publi, only your app can access to your data.
A good lib/sample for beginning with content Providers is data droid http://datadroid.foxykeep.com/ It will do all the stuff for you.
If you are using the data directly in a ListView for example, it might be beneficial to create a content provider.
You could also opt for a different abstraction within your app, for example a new class that abstracts out the different sources. I don't really see the argument for using a content provider just to make your app more maintainable.
You might even argue that a content provider adds more complexity while you are not using most of it's features.
If you do go for a content provider you can add it to your main app as a component by declaring it in AndroidManifest.nl just fine and you can develop and package the app in Eclipse like you would normally.

Can Two separate Application share their resources like database?

I have two separate Application in the same work space Now can i use resourses like.. database of one application in another??
please help me out..
The normal way of sharing data like that between applications would be to use a ContentProvider to proxy the database and make it available in a managed way.
Yes they can, multiple applications with the same sharedUserId in the manifest, and signed with the same key, can access each other resources.
Take a look at this links:
http://androidboss.com/androids-shareduserid/
http://mylifewithandroid.blogspot.com/2009/06/controlling-application-separation.html
It has several issues regarding security and permissions but yes it is possible, as if you are android user some application asks to get your contact list details? How do they get into your phonebook application and get details from there? got a clue?
now follow this link it may help you
http://developer.android.com/guide/topics/security/security.html
Be ethical,
Happy Coding

Whats the best solution for a database used in conjunction with Maps in Android?

Could someone please point me in the right direction. My project involves a database where users enter their address and other info from my website. This database is then referenced in my android application to show the locations of these addresses in my database.
I have yet to start and just came up with this idea. My question is, what would be the best method to create a database easily modified through my website (mySQL, php, etc), and also easily referenced easily through Android and the Google Maps API? I need some ideas on the languages I will need to use to create this database and website so I can go buy the necessary books to start reading up.
Thanks so much
I believe the best way for you to go with this one is:
a database cache on the device
that means you can use XML if you don't have many complicated requirements from storing the address
or SQLite if you want to be able to query the database and do more fancy things
on the server side
if you only need to get the data from your server on the device, then a simple XML with a unique address per user should do it
if you need to push addresses from your device to the server then a REST system needs to be implemented
So, now you just need to figure out exactly what you need from your system and then start googleing on one of the solutions I gave you! Good luck! :)
Google App Engine would probably work for that. GAE supports Java and Python. Maybe use the Restlet framework (compatible with GAE) to implement a REST architecture.

Categories

Resources