I need to create 3 things:
Content Provider
Service
Application
I'm wondering if these all three will be in one single project, or they will be three different projects?
Also how can I limit my Content Provider to my services and my applications?
Regards,
Pentium10
They would be a single project. They are application framework objects and not as heavyweight as you might currently believe.
As far as permissions, check the security guide
To get more detailled answers maybe you could specify what type of "Content Provider", "Service" and "Application" you 'need' to create - and why..? ..a pay-for-content app..? ..a music-download portal..?
Related
i have two or more applications.
one of them is the base application and the others are just extensions(add-on).
i want when user install base Application and after that user install other extensions of applications, some features be enable in my base app. something like Go launcher App. if u want to use go launcher themes you should install themes and you will allow to use themes in go launcher app.
is it possible in android?
if it is what do u suggest?
thanks for any suggestion.
Use Content Provider to achieve your task.
This example contains two applications like parent and child. it performs data sharing, database in parent application and child can access parent database using content provider.
Refer This Link: http://www.compiletimeerror.com/2013/12/content-provider-in-android.html#.V4STZjVazDc
aidl meet your needs ! App1 call App2 method use binder
In creating a mobile application for Android, I am dealing with a SQLite database which requires a ContentProvider. The ContentProvider is used for adding, update, reading, or deleting data from the database.
I read http://developer.android.com/guide/topics/manifest/provider-element.html but I did not find any further information what it means, especially for working with databases.
I have seen some manifests that define the following provider:
<provider
android:name="main.ContentProvider"
android:authorities="main.ContentProvider"
android:multiprocess="true">
</provider>
What does it mean to have multiprocess set to true? Does that mean many database queries will be handled simultaneously? And if I set it to false, what happens then?
Thx.
An Android framework engineer said "Don't use this attribute"
https://groups.google.com/forum/#!topic/android-developers/u9UMJtALSXw
Don't use this, it is some old cruft from pre-1.0 design that doesn't
work and should be ignored these days. Just pretend like the
attribute doesn't exist. :}
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email
to android-d...#googlegroups.com To unsubscribe from this group, send
email to android-developers+unsubscribe#googlegroups.com For more
options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-- Dianne Hackborn Android framework engineer hac...#android.com
Don't use android:multiprocess="true".
Not only does it passively not help you, but it even actively causes other problems. For example, if you have android:multiprocess="true" then android:process=":something" doesn't start in a new process.
As I understand it, ContentProvider - is the data on the global level of the whole device?
The questions:
1) Is it possible to develop and distribute only ContentProvider (no Activity, ie not as a complete application, but only as data)? Does anybody do so? And when?
As for the user it will look like? What is the difference between build of ContentProvider and build of normal application?
2) If another developer wants to use my ContentProvider, then how he will be able to access the column names and other data necessary to work with my ContentProvider? I have to give the library?
Sorry for my English.
Thanks
1) Is it possible to develop and distribute only ContentProvider (no
Activity,...
You have to add at least one Activity to your App to be launched by user.In fact forsecurityreason all services,receivers,... that you declare in manifest,will not register unless your App run explicitly by user and this needs to a Main/Launcher Activity.So you have to add such Activity to your App.
2) If another developer wants to use my ContentProvider,...
You have to publish documentation in about your App.
1) Is it possible to develop and distribute only ContentProvider?
Ans:- You need to add at least one activity to your application and all the resource in the menifest will be registered once your app will be launched explicitly.
2) If another developer wants to use my ContentProvider..
Ans:- You need to provide the proper documentation for accessing the content. Other developer can use the content of your app b using the URI which is defined with your ContentProvider.
I have two apps and I want one app to change preferences in another app.
Is it possible? If so, then how?
It means that you need some passage between two applications.
If A application provides content provider, B application can access that content provider and change values in that provider.
Have a look this article http://developer.android.com/guide/topics/providers/content-providers.html
You could use Content Providers. Put your settings in a database so that the other application can read.
I've read Android dev guide and notice that we can implement different classes for the content provider. So,
There are many content providers or just one content provider in one Android app?
How to properly implement different content provider classes like that?
Here is what I read from the dev guide:
You implement a provider as one or more classes in an Android
application
http://developer.android.com/guide/topics/providers/content-provider-creating.html
You can implement as many as you want, as you can see from the documentation here. To register a content provider, you need to add its corresponding <provider> tag in the Android Manifest.
In most cases, however, you won't need multiple content providers. One is usually enough, as it can handle multiple tables. You should only really need more than one if you want your app to provide public access to 2+ separate data entities.
You can use (provide as well as use) as many content providers per app as you need. They need different content URIs, of course.
In addition to the uses outlined in the document (your link) you can use content providers for other purposes as accessing data storage. The content URI can have parameters, so you can use a content provider similarly to a web service.
You can create as many content providers as you want. But do you need them al?
What content provider classes do you want to implement? If you read the page very good you should have seen that it contains links to two pages:
http://developer.android.com/guide/topics/providers/content-provider-basics.html - Content Provider Basics
http://developer.android.com/guide/topics/providers/content-provider-creating.html#ContentProvider - Implementing the ContentProvider Class
I suggest you first read those pages. Google is giving some more information about Content Providers, tutorials and examples:
http://android10.org/index.php/articlesdatastorage/252-content-providers-using-and-creating-them
http://thinkandroid.wordpress.com/2010/01/13/writing-your-own-contentprovider/
http://www.vogella.com/articles/AndroidSQLite/article.html
http://about-android.blogspot.com/2010/04/content-provider-example-1.html
There is no rule as such that you have to implement only one content provider per application. If your project demands, then you can do so.
If you want to implement multiple content providers in your application package, then make sure that authorities part of each content provider is unique, to route the incoming data requests to each content providers properly.
But having too many content providers can really confuse you and not required.
The only scenario that I see to have multiple content providers is, if you are having multiple databases in your application and you want to share all those databases with outside applications. Where you can use separate content provider for each database to share it with outside world.
Hope it helps.