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.
Related
I want to know how to modify message data, neither root nor default application in android application
Goal is block number list manager and i want to receive message of to filtered number I’ve looked BlockNumberContract api but this require permission like default sms/dialer application, carrier application Only default application(User is chosen application) will have access MMS-SMS ContentProvider when on android 4.4+ I was check to LINK
Also, If you know anything else, please let me know them
Additionally if impossible on android application level, Please another level any solutions and any ideas let me know
thanks :)
You can't. That's the entire reason they created the Default Messaging App- to prevent you from doing it. You need to be the default messaging app to do this- or at least root and directly edit the db.
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
I need to place a file inside of another application's specific folder. Is there a best practice, or related expected behavior for this?
To solve the issue, I have created the desired file during my APK's installation, then written its contents. While this works (since I have root rights), I want to know if is there a way to "request" another application to "create the file themself", this is mostly to guarantee that when that other application is removed, that it removes its files (since my app is the owner of that file).
I am unsure if this is considered good behavior, and could not "phrase" the question in a way that showed related results (I am not an native English speaker).
I need to place a file, inside of another applications specific folder
If by "applications specific folder", you mean internal storage, this is not possible, except perhaps on rooted devices.
I want to know if is there a way to "request" another application to "create the file themselfs"
Not in general. Some developers might have an API for this in their apps.
The official way of sharing data between apps is ContentProviders.
There is no limit to what may back the specific provider - a file, database or some other data source. I think this is the best way to go in your situation.
The approach you have described is indeed strongly advised against. The whole Android security is based on the idea that you can't directly access the data of other apps.
Ok, here is my proposal. I will assume that you can add functionality to the server app or define some technical guidelines for it at least, so that it's developers have to add the functionality.
A - Server App
B - Client App
[B] Create the html file in the common storage
[B] Save its location to some String variable
(Optional) [A] If there are more server apps that the user can choose from, make sure they all have a BroadcastReceiver with a common INTENT_ACTION.
[B] Send a broadcast Intent with the path saved in 2. as an extra value.
[A] Receive the Intent, check if the path in the extra is present.
[A] Get the file from the received path and copy it into the internal storage.
(Optional) [A] Add a BroadcastReceiver to monitor app uninstalls. When notified about the client app being uninstalled, remove the html file you received from it.
This is the basic algorithm, but I guess the implementation is obvious enough. Let me know if it solves your problem.
I understand that intents can be used to employ external activities to accomplish specific tasks, my question is whether those called external activities can be included within the project itself.
For example, if I wanted to include check-in functionality to my application, and knew that google plus has this great check-in activity, would it be possible to include that specific check-in activity for use in my application?
You need the intent of that activity. I think if you have installed G+ app, you need to iterate through the list of Intents you have installed and find the matching one.
List<ResolveInfo> IntentsList= getPackageManager().queryIntentActivities(new Intent(Intent.ACTION_MAIN, null).addCategory(Intent.CATEGORY_LAUNCHER), 0);
PackageManager.PERMISSION_GRANTED = 0 in the addCategory
The 1st argument of addCategory() method varies whether the intent category is CATEGORY_LAUNCHER, CATEGORY_ALTERNATIVE or most likely your required intent to be CATEGORY_DEFAULT. If you know the intent name then you might be able to call it in your activity, also adding it to you manifest as activity in your application.
The short answer is yes, if you had the library project for the external app you want to use. This generally not the best solution because if you could get the source (a big if) and then the user downloaded the app then you'd have to choose which app to complete the intent with (if you didn't use explicit intents) plus you'd have to update your own app when theirs is updated. All this creates overhead on you. An alternative would be to follow the example of the Text-to-Speech library. The Android O/S doesn't come with one preinstalled so whenever the functionality is requested the user is prompted to download the related library. Just uninstall Pico TTS and you'll see what I mean.
What is the best way to discover an Android application's API or hooks into/from the application?
Specifically, I am looking to pass a parameter or data to an application, utilize the application's specific functions, and return data or a parameter to the calling application.
A few ideas come to mind, but I am unfamiliar with what is available, specifically to Android.
Contact an application's developer directly
Somehow decompile the APK to browse the source
Read any available documentation
Some ways to check out what is available for :
Tool to re-engineer closed APK files
http://code.google.com/p/android-apktool/
Review intent filters for actions
Lookup the app in some sort of application manager on your phone. Android System Info. If you go to the details of the app it will tell you where the apk is and the name of it. For instance, under the Email app you can see "Source: /system/app/Email.apk".
To pull that off just do "adb pull /system/app/Email.apk Email.apk", to pull it to your current directory.
Look at the Manifest.xml. Rename the apk to zip and unpack.
Follow the instructions here: http://android.amberfog.com/?p=582
Then you can read the decompiled Manifest.xml and look at the intent filters they are registering.
Android applications are all in their own sandbox, so you can not just arbitrarily call some other Android applications' functions, they would need to be made public to you somehow.
If you are looking to execute some function that is provided by another Android application, you would most likely need to hear about it from the developer, most likely from their public documentation if they have any.
The correct way to do this is to use "intents". With an intent, you can launch another application (such as a barcode scanner) and the user interacts with it. Then, the application exits returning some data (such as the barcode). Try googling or see:
http://www.vogella.com/articles/AndroidIntent/article.html