How to access or modify Android ContentProvider? - android

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.

Related

Android: Sharing Data between multiple applications

I have a requirement, wherein I have 4 android apps, which are sending notifications to a user, at a fixed time of the day. A user could have one, or more of these apps installed on his phone.
I want only one of the apps(any one) to show this notification to the user, because multiple apps popping up notifications is a bad user experience.
For this I need to share some data across the apps.
I was thinking of a mutex/lock based approach, the problem is, where do I store it?
Problems:
Shared Prefs: I don't know which app wrote the data first, and from which app's context should I read.
SQLite: Same Problem as above and app uninstalls need to be handled and SD card might be missing
Server: Mostly offline app, dont want to add internet permission just for this
I see files at a common location as the only way to store this information.
Is there any better way
As you said that the easiest ways is with file,
I did this before and i too wasn't able to find more easy way.
when you show the notification first time then Just make a new file anywhere which can be common for any app and then check if file is exist.
if it exist then don't show the notification and if not then show and make file again, also remember to delete the file from any of your app when day changed, use AlarmManager for this.
hope it helps.

How to share data among applications when we don't know which app is provider but first app has stored data

I have 5(any number) android applications which will share some data.
Now when 1st/2nd/3rd..(i couldn't know) android application will get installed by user, it will save a string in the memory(internal memory),
When any other application will get installed, it should know that one of the app has already written data and now it should act as user of this data.
To sum up, first app installed will act as provider and others as users...but all the applications can be potential provider and other as users..
Is this feasible?
i tried using file/shared preference/content providers...but in file, you should know file path before using it which is dependent on package name..
In shared preference, we have to create package context..
In content provider, we have to import provider package..
My real motive is, actually in each app, i register the user first time...
now i want , if user install 2nd app from me, it can just use data of first app and do not ask for register..
but the problem is i don't know which app will be installed first by user..
Please help if i can use some other approach??
i found one thread related to this...
https://groups.google.com/forum/?fromgroups=#!topic/android-developers/W-oOa0x9amg
http://android.bigresource.com/Android-How-to-share-data-between-applications-with-no-dependency-HRMMGMIkL.html
This thread pretty much answers my question, in terms of feasibility and options i have for this scenario.

Control default contact list and messages app

Is there a way I can control what contact list and messages show? I want to make an app that if enabled will hide certain contacts or messages from certain people. I am not sure of this is doable
Please let me know if this can be done programmatically. Please note that I am referring to the default contact/messages APP that comes with android and I want to be able to control what it shows from my app
Thank you
Please note that I am referring to the default contact/messages APP that comes with android and I want to be able to control what it shows from my app
Fortunately, this is not possible, except by modifying the actual data, as noted in a comment on your question. You cannot hack into other apps like some script kiddie.
Note that, due to synchronization, deleting contacts may wind up deleting them from an upstream data source. The user may not appreciate this.
You are welcome to build your own contact app that maintains its own filtered list of contacts.

Can I restric user access to the default browser in Android?

I am planning to develop an app that will help the users to protect their Android phones from unauthorized usage. So the user can set to restrict others from using the browser, make calls to a set of numbers, send sms/mms etc...is it possible to all these...i have seen blogs saying that it is possible and not possible. I am confused..
Please guide me..
http://blog.wangling.me/2009/08/why-it-is-impossible-to-intercept-incoming-calls-on-android/
Happy Coding
"Can I restric user access to the default browser in Android?" Well,if you really want to restrict user to use the default browser then answer is yes.You can do that.To do that your application will have to run a service that will check running processes periodically.Then from the process name you can find out the package name.For default browser it is com.browser or may be android.com.browser.And you can kill any process by using killBackgroundProcess(pkgName).Check whether browser is in foreground.If it is then send it to the background and apply the method.This you can do in extreme case if you want.But it is really not a good idea and not recommended at all.

Android application's exposed API or hooks

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

Categories

Resources