assume I have an Android app written in Xamarin. Is there a way for me (i.e. the developer who publish that app on the Play Store) to interact with the users of my app by sending some information that is automatically stored in a local DB?
In particular, I want to send the users a new code that will change the behaviour of the app based on some previously coded logic.
For example, assume the app when loaded reads a table on a SQLite DB and looks at the most recent record. Say that when the app is installed and launched the first time, the first record has a value equal to 1.
The app reads that table every time the app is launched and based on the most recent record some behaviour of the app changes.
For example, at start (i.e. when the most recent record is equal to 1) the background color of my main activity is white. Then I send a new code to the users and say that the new record added to that DB table is 2.
The app now reads that record and changes the background color to green (because, when designed, the app has some switch case that changes the background color based on a given value, i.e 1=white, 2=green, etc.).
Is there a way to achieve this?
Yes you can.
First, when starting the application, you send a request to the server to synchronize your local database, so you will get always the latest values.
After that, you can load the views according to the information that you have, and apply your logic.
Related
So I'm making an app that asks users for their percentage and then give them a list of colleges that they can apply to. There's just one problem, the colleges release four different lists of cut-offs over a span of four weeks, and I want the app to be made in such a way that the I don't have to update a static list inside the app and make the user download the updated version but rather to make the app read that data from a remote location? Is that possible?
For example I expect this kind of situation: data in my application lost relevance and so it usless until update. And until update it have to show users some predefined message.
Is here any simple and free solution to this task?
Guess I can use some server to somehow send simple messages... but it sounds way too complicated.
If this is important I use Xamarin.
Update: main difficulty here is fact - my application can't in any way define if it's outdated or not. This may happen in random moment.
Although the requirement is not very clear I assume Update here means app update.
each time user launches app make call to an api on ur server to check if user needs to update app
If that returns true take user to a static view that says app needs update and redirects user to google play to install updates
If you want to avoid using a server, you should try Firebase (https://firebase.google.com/). More specifically, you should use Firebase Remote Config (https://firebase.google.com/features/remote-config/).
Define in a key-value pair of something like minimum_app_version_required in Firebase Remote Config. Every time user opens the your app, compare the values of app version and minimum_app_version_required that you are getting from Firebase console and show a dialog box accordingly. You can also change the value of minimum_app_version_required anytime you want.
Just set some internal flag. That when that situation occurs, you can set the flag to true and just edit whatever layout element you are using such as listView or any other element with your predefined messages saved in strings.xml. You can also build any custom pop up screen, depends how you want to show them. Let me know if you didn't understand or exactly how you want?
Need to implement versioning for this problem. To achieve this, you have to maintain a version number in server, this is the version number you app will have to save and use it to validate with server. If both are not same, then app will get the latest data from the server.
I am a product manager and I want to understand if it is possible to create an application (the question is relevant for both OS) with the following behavior:
When the app launches for the first time, it will call the server and download all the GUI texts.
As part of the response, it will also receive a GUID.
on every next launch it will call the server, and get the GUID. if the GUID is new (doesn't match the current stored GUID) - there was a change in the GUI texts - and it will replace all the GUI texts with the new ones
Is it possible in android and iOS - and what are the limitations?
I am interested what approach to choose in situation if you have a client/server application in which you have some categories (just a type name - like coffee shop, restaurant, etc. and an icon for it), that you may want to expand in future.
One way to do it, as I see it know, is to have a string list resource (xml) and appropriate icons on the client side (concretely Android client), and when you want to add new categories, you will have to build new version and deploy it (if I'm not wrong and it all gets to binary for when compiled).
The other way is to have the type list on the server (let's say as a simple entity with type and icon), and that you're client fetches for it whenever is needed, per example, first fetch all the category names, and then the appropriate icon for selected.
So I'm interested in what is better in a situation like this?
This is ultimately called Syncing functionality. It depends on the requirement and situations.
There are actually 3 ways to implement such functionality:
Put all the required things inside the app and deploy onto the play store.
Put static things inside the app(client) and dynamic changed values on the server.
Put everything on server and sync into client as and when required.
Way 1:
In this way, you need to put everything into the app. Advantages of doing it are you would not have to depend on server and it loads faster. Disadvantage of doing is you would have to deploy app as and when data changes, even if you do a change in single value.
Way 2:
In this way, you can keep static things like company logo, company banners and all such values which are usually don't change frequently. And you can store rest of the values which you think changes frequently like employee list/details.
So if there is new data available, client needs to be notified so that it can sync latest data into the local database.
Advantage of Way 2 is you wouldn't have to load static things again.
Way 3:
In this way, everything is supposed to be on server, client has to sync data on first launch and then whenever new data is available.
Advantage of way 3 is you don't need to deploy app if any change in data values. But as this is depend highly on network connectivity/server, developer has to implement all the corner cases to avoid sync/data loss.
Is it possible to edit contents of an android app through web site? For example, contents in a page (videos, texts) & layouts (location, size, colours).
Yes it is possible using like Client and Server approach where your Android app works like Client and your Website is like Server.
You can first download a data and store that data into SQlite and whenever you open a application every time app request to Server asking for New data.
You an achieve this using Sync Date & Time. Like whenever a website update there data then change Date & Time and when your request New data will check Date & Time. If Date & Time change then your app show update data message or New data available message. In this way you can achieved.
I think its not possible directly but sounds like you are about to use wrong pattern. The right pattern is a client-server one, where android app is a client and website with REST or any other custom API is a server. Application should request data from server and display it in a way you set up. So you will edit any data on a server and your app will receive changes on request.
I am not sure what you are trying to do but with any UI field, you can code it programmatically. So for instance, you have a button and want to be able to change the text on it, you can technically do this via a website:
You will need some sort of database management system that will control the content of the app. The app will just have to call the database to get all the data/fields it needs. You will pretty much be making a content management system for your app.