How to send a SharedPreference from an App to another? - java

Hey I have an app(Let's call it app A) on the playstore and I want to replace it with another completely different app(Let's call it app B) but I need some of the SharedPreference in app A to be sent to app B but I don't know how to send data from an app to another does anyone know how or if it's even possible. I tried creating a file containing the data on the sdcard but I don't like that idea since it is not secure, so if you anyone has a better idea please help me.

I think best variant for you would be sending an intent with all preferences you want to store from the first app. In second app you need to register intent receiver that will get all data from intent and store it in preferences. Here is an article that described this approach more detailed.

Related

Save states of multiple activities - Android Application

I have read many posts about how to save a state of an activity using ViewModel and onSaveInstanceState(), however, I couldn't find something that explains the possibility of saving multiple activities states to get back to them using an "Edit" button (to edit some application information). Is this doable? Can someone enlighten me?
Thanks

How to let your app take data from apps that are already installed by Android

I want to make an app that takes info/data from other apps that are already installed on my phone ( Android ). By example: Let's say I want to make an app that shows how many messages I sent to each person with my phone. Then I would like to get my app linked with the message app on my phone and count how many times I sent someone a message , get that data, and put it on my app.
When I search for this problem, one 'solution' I found was working with intents, but it's NOT that, by far as I know, you can use intents to share data between apps you created yourself. I want to be able to get data from apps that I did not make. HOW? Thanks already
You can't, otherwise it would be a security issue, think about a bank app... In Android all the apps are fisically separated into different directories.
You can access data only from apps that expose methods, like Intent.

Calling APP Functions outside of app?

I'm a beginner Android developer so sorry if this sounds stupid but I'm trying to figure out how to call a function of my app or to call the app outside of app itself. What I mean is, say that you're playing a game, talking to friends or watching a movie. I was wondering what approach I would use in order to solve my problem?
Also, I was wondering how I can get my app to appear in the notifications panel persistently (such as that it's online kind of like BBM).
Any help wold be greatly appreciated,
Thank you in advance.
You can create a service in your app and declare it in the manifest so that other apps with a specific intent-filter can call and initiate your service. It is also possible to have the service running in the forefront (like how Facebook messenger works)
I don't know about persistent notifications, but you should check out Push Notifications in general. You can easily create one within the app. Possibly monitor if it is dismissed and re-initiate it?

Android: How to send push notification to other users with the same app?

Recently, I'm trying to make a app that will send a simple notification to the user with a certain ID with the same app. However, since I'm new to these types of development, I want to know if I should use a GCM or if there are some better options. I've searched over google but couldn't get a good solution to it. If possible I would want some tips.
Hi in my oppinion and from personal experience, i belive that in case when you are not sure, or dont know for better solution, it is best to use what Google offers you,in this case GCM, which works quite nice.
https://developer.android.com/google/gcm/index.html here you can get all infos what you need about GCM.

How Can I Communicate with another application?

I'd like ask you if there's a way to send information or commands to other applications.
For example: a person is typing a message to one, and after ten seconds my program adds (by using the command append("text").to(EditText); ) a string like "hello" in the EditText of the message.
I discovered that information can be shared between different apps through ContentProviders
Is there a way to accomplish this?
This is only possible when the developer of this particular app predicted such behavior. It could be done simply by broadcasting intents between apps, but this "another" app must have a suitable Broadcast Receiver to make a use of this intents. http://developer.android.com/guide/components/intents-filters.html
Or, you can fire up an intent on another app and bundle your Data into it and pass it through Intent object. Check out this link. I purposely haven't written a code. I think everyone should learn on their own. Remember,The developer site is the Bible for Android.

Categories