Storing links that may change in android app - android

Inside my android app I have hardcoded a link to some web service. Now every time the link to the web service changes, I need to make an update of the whole app through Goggle Play for changing this link.
Better would be if the application first connects to some other “static” web service and then gets the properly link that I can change whenever I want without an update.
Even better would be if it could be done somehow with Google Play, but I didn’t found any information for such a functionality.
Are there some suggested solutions to do that?

Implement GCM in your app and push notification with new url to all devices any time it changes. Then store that url in shared preferences / database on device.

Related

How to notify my app about newly available resources on the server to download?

I have an app to display images in sequence (as a slideshow). Images are downloaded from the server and stored on the device then it is displayed in a slideshow using ImageView and TimerTask. I would like to tell the app that images have been updated on the server and force it to download them again.
How do I tackle this?
I used firebase messaging service and it worked like a charm. As some member(s) might have mentioned, the downside of using notification is that it can be switched off from settings and then you lose your communicate channel with the App. It's best to use web sockets to have a full communicative channel with the App (but again, 4g/wifi can be switched off as well..).
I have followed the following tutorial to get started.
https://firebase.google.com/docs/android/setup Click Here

How to update mobile app UI(android and iOS) when web UI is changed

I had a requirement in our company by senior management.We are working on a business app that can create,initialise and submit a process.This is both for web and mobile.Below is the flow of the app.
User logins in to the app.
Creates a process(a process is a form) by using a drag and drop UI.
Created process is initialised and submitted for approval.
Above is the flow of the application.Now,the requirement for mobile is,once the process is created in web that has to be dynamically updated in the mobile app.
What will be the better approach for this kind of requirements.
**Note:**Please don't get confused with the term process.Creation of process is some thing like leave request process,HR processes etc which are just normal forms.
Technically speaking,need solution for a form customisation using a drag and drop that has to be updated in mobile dynamically when changes are made in web.
If I understand your question correctly, then what you want to do is keep a process in sync between the web and your app.
You have two choices. You can either make a call to your API every x seconds and check if there are any changes. The other way would be to use WebSockets which allow you to push data from the server to the client instantly. (So you when there is a change you can notify the app and update immediately).
Both ways have advantages and disadvantages, especially when scaling your app. If you want to have a "real-time" feeling in our app, I would recommend using WebSockets.
You need to have a progressive web app and try out the ionic cloud services
https://docs.ionic.io/services/deploy/
Live deployments let you publish web assets such as HTML, JS, and CSS directly to your users without going through the app store.
This lets you:
Update your application on demand.
Get new features and bug fixes to your users quickly.
But it has a price associated with it but!

how to update your android app daily without asking the user for update or download

I'm new to Android and I'm thinking of uploading my app to the playstore but I haven't tried uploading a single app.
I already know the steps in uploading however there is something that I need to know first.
I want the app to update everyday that doesn't need to notify the user for update. Say for example, in a bible app there is a "Verse of the Day" which is updated daily without downloading an update, just stay connected to the internet and the verse will be updated. I have no idea on how to do that. Is it just uploading a newer apk daily? If so, do I have to notify the user? How do I do that?
Any help would be appreciated.
Method 1:
Basically, what you are planning to do that can be achieve using API.
If you update database on the server then the API will automatically update the new data in the user phone's when it starts.
You can also implement logic that when any new data is added you can fire a local notification from the app and the user will be notified!
Reference: http://code.tutsplus.com/tutorials/android-sdk-making-remote-api-calls--mobile-17568
Method 2
You can create service or background activity that keep on running and calling your API after some interval of time. Whenever new data is received it will fire local notification. (This is not an efficient way because it consumes memory and internet data both)
E.g.: Alarm Manager
Reference: http://www.vogella.com/tutorials/AndroidTaskScheduling/article.html
Method 3
You can implement "push notification service", so that you can push notification on the user's device without updating your APK.
Reference: http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
P.S. All these method can be done without releasing the new APK on the Google Play Store.
I don't really know what your problem is. You have to host your "Verse of the Day" somewhere online and in the app fetch this data from the server. Why do you want to upload a new version of your app for this?
For the latest content that you want your app users to have, can use the Couchbase Mobile feature called Live Query that abstracts out having the user explicitly ask the server for any updates.
When the app is connected to the internet again, content will be updated accordingly if the user's Android app does not have the latest content locally.

Update android application using OTA

I am having my own apps store where all android applications are hosted. Some apps are modified. So How i can send updates to clients/users using OTA. So clients will come to know about new updates and he will be able to download it.
Found an interesting solution on HN a month back. This is related directly update the app on the client without any user interaction. And since you have your own app store, shouldn't face any problems as listed in the HN thread.
The solution working snippets from the website-
...intercepts all calls to startActivityForResult, getResources, and some other functions. When you try to start an activity, Evolve generates a dummy class and sets its superclass to the activity you want to start.
...dynamically generates the bytecode for a new class
...then changes the intent to start the appropriate class
This is still in alpha mode, so would require some effort from your side to integrate.
Link to solution - http://blog.vivekpanyam.com/evolve-seamlessly-deploy-android-apps-to-users
Assuming this is what you are expecting, hope this helps!
1.Create a Web Service which your app can poll whenever the app launches or based on some time limit that can check if there is new version out there.
2.This Web service should return the lastest Version of the apk file that is hosted on the Server along with the URI of the application file that has the new version.
3.When your app gets the response from the Web Service, it will parse the JSON and check your app version to the lastest version that is available on the server.
4 If your app version is lower than the latest version it will prompt the user to start the download process.
5.The download of the new app is handled by the Download Manager.
The download manager will notify your app using Broadcast receiver when the download is complete.
6.Upon completion of the latest version of the application file the you can start the activity to install that file.
At this point user needs to say OKAY, lets do it.
Check this https://code.google.com/p/auto-update-apk-client/
If you have your own app store, then you must have a client app running on the relevant devices that allows them to install/update apps from that app store.
As part of that client, you can have a service, that enumerates the installed apps on the device and checks with your store whether updates are available. If yes, then it presents the user with a prompt to visit the store to update the corresponding apps - or do whatever else is appropriate in the situation.
You may also want to register this service to receive broadcasts of network connection events so that if there is no internet connection, the service will receive a notification when the connection is available again.

Android Chat Application - single sign in

I have made a chat application of my own. But in my chat application I have to login and logout again and again. I want to make it as What's App or any other chatting app ( i.e the user should login only once and rest all the time when there is internet connection available he/should getconnected to the application automatically and vice versa.
I have got no idea how to manage the same. I have searched it thoroughly, have found a clue regarding Application Class. But not enough so that I can use it in my application.
Please help me with a hyperlink regarding my requirement or guide me with a set of code so that I can start with.
Thanks
You do not need a Service class for single-sign-in! Use the SharedPreferences class.
You can persist the current user's password on the client device and use this to authenticate against the server every time the user opens the app.
Tech Lead on the Android Developer Relations team specifically recommends SharedPreferences: What is the most appropriate way to store user settings in Android application
If you want to receive messages in the background while your app isn't in the foreground, then you probably want to use Service class. You will probably want to use Google Cloud Messaging as well, which Google developed to help you with push notifications.

Categories

Resources