Android Activity - Design on Server / Render on Client - android

We have a Windows Mobile application which is being migrated to Android. It has a large-ish number of forms (around 150). Given the complexity of the rewrite ahead of us, I am looking for as many shortcuts as I can find :)
One of the options we are considering is as follows:
Move all the .NET code from the WM application to a server component.
Build or buy a component which runs on the Android device, but is a "mildly intelligent" interpreter.
Code which would in the past have acted on the form directly, would now act on an intermediate object.
This object would be passed back to the App which would render the output.
The user sees the screen, scans or keys in data and a new request is made back to the server.
I'm thinking of something similar to a terminal emulator - except I want to be able to do something a bit more "intelligent". For example, screen types to:
show some data in TextView objects
display data in a table (something like a gridview) and allow selection of a row
enter some text
enter a date
select from a drop-down list
Once the user completes the screen, the information entered is then sent back to the server for validation. The server will construct a new screen object and sent it back to the device.
Would anyone be able to point me in the direction of a pre-built component we could purchase? Is this possible?
Regards
Tim Muir

Related

Should we use backend code or Client side code for e-commerce android app

I am working on an android e-commerce app and recently I'm having little doubts on some concepts.
Should I include my functions in the client side apk or on the online servers (like Google functions, Amazon lambda)?
For example an user adds an item in his cart
Should I include my code in the client side apk like:
Get the item's price and multiply it with the quantity and then add to the total price of cart.
Or should I just send the data from the client side apk like:
Send the unique ID and quantity to the specific function in online functions
And then put the multiplying and stuff... in the online functions.
Where should I include these calculations?
I think the important thing here is how you're managing state. When the user adds something to their cart, does the app tell the server they've done that? Do they have a cart on the server, with a list of what that user has added so far? Or does it all happen on the user's device, and the server doesn't know anything about the cart until they go to check out?
If the cart is managed on the server, I'd say it's better to let that handle all of the state, and let it tell the device what to display. If the user adds 2 items, tell the server what they've added, and the server can say "your cart contains this" and include the price in that information. It gives you more control, because your server is the source of truth - you're not relying on the device to get it right (which sounds silly but a lot of weird things can happen)
Whatever you do though, don't let the user's device tell the server how much the items cost! If it's calculating the total for the user then fine, so long as it's for display purposes. But when it comes to calculating how much the items cost at checkout, you do that yourself, server-side - take item IDs and counts from the user, nothing else. If they fake a request that says 50 gold watches for $1, you'll be in big trouble!
That might be obvious but I had to put it out there just in case!
It depends on where you're calling that function from. If you're calling that function from somewhere in your front end code, you should include it in your client. If you're calling the function from somewhere in one of your Lambda or Google functions, then you should put it there.
The concept that you might want to learn about is called scope. Wherever a function is in scope, some thing else can call it. You might consider looking up the rules for scope in your specific programming language.

Changing GUI text in android and iOS based on server data

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?

How to pass data from a web page to an app which is about to be installed on iOS and Android

Is this possible to achieve on iOS and Android with the least manual operation?
The user visit the web page W and W stores data D somewhere (in the device or the server).
The user install app A and A get D (from the device or the server).
I can only think two ways to indirectly achieve the same result:
W asks the user to copy D into the device's clipboard, and then A asks the user to paste D in the app.
W asks the user to write some random string X (and save the mapping from X to D), and then B asks the user to type X (and get D by sending X to backend).
Btw, after googling a while, it looks like current mobile browsers cannot access the clipboard, and W3C is just writing the draft of clipboard API (2014/09/18 http://www.w3.org/TR/clipboard-apis/ ), so using clipboard as a "hack" to pass data automatically is not possible currently.
We also struggled with this when we built our last mobile app, Kindred Photobooks. We actually created a native library for iOS and Android to do just this - give you the ability to pass data past install. The best way we found is to basically bundle that information in the link and use fingerprinting to make that data available after install, which is working really well.
You can try to build fingerprinting in in house as well - basically create an outstanding device fingerprint once someone clicks on the link and match it to the fingerprint that you create once a user
We automated everything and made sure all the edge cases work on both Android and iOS. Check us out at branch.io and if you are curious on how our links work, you can read more here.
I don't exactly what you want to do, but, you can for example, on the web page, ask the user to enter some info, and then you send to his email a code, then he can share that code with other people, and inside the application, you create a section, so user can enter a code. Using that code, the app makes an HTTP call to the server, and the response can be the info entered by the first user. Of course you are going to need a database.

Which way is better efficient to log user's activites(history) in android?

I develop the app which is provide some information to general user. it is not only showing info but also curating and recommending further detail info depending on users history;what the users clicked, searched and acted on the app. (like a google targeting AD).
For this, I have to accumulate user's activites on apps. (which button was clicked, when did they turn on the app and so on...)
For this, I have two ideas.
1. let the app to leave their log text file in local device then append lines in it whenever user act, and upload it when they turn off the app on server DB.[like a batch]
-OR-
2. let the app, update db everytime when user acts something on app by http-post.[like a realtime]
Which way is common tactics(or popular ways) on real field? or can you suggest another way?
thanks for reading.

Have data fixed or fetch for it Android

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.

Categories

Resources