Syncing Android and IOS app with backend after live in future updates - android

So the app I am building for a client is in final stage of release. I would like to get some help from here about syncing the API with future updates on app. I will give a scenario:
Lets say our app is live with version 1.0.0 on both IOS and Android. Server keeps track of version number and if it does not match(will always be less if not updated) it tells to force update the app. Everything works. The problem arises here.
Lets say we need to provide some feature update on 1.0.1 we make the code ready on backend but does not make it live on production until the apps are live with new update otherwise old app might not work properly with new API changes. If any one of the app(lets say IOS) is live with v1.0.1 we need to make the backend live. It will work on IOS. But for Android if v1.0.1 is not live yet the old app will say to force update since version is already changed in backend. but since its still not yet live user are now stuck with force update screen.
The solution I came up with is to fire 2 express server with same code but 2 branches for production like production-ios and production-android.
How do you guys handle these kind of thing? Its my first big FullStack app and need to figure this out soon.
Cheers!

How exactly are you handling the app update version tracking?
Is it done via JSON or some other text file content?
JSON would be a better option to set multiple parameters like:
{
"app_update_details": {
"app_version": "1.0.1",
"ios": true,
"android": false
}
}
Parse this Json accordingly on your platform (Android, iOS).
This way you could the android flag to handle Android use cases & same for iOS.

Related

Where do I put code that links app to Twitch OAuth and channel chat

I'm currently using Android Studio 3.0.1 to build a very small android app that will be used to send specific chat commands to the users twitch channel chat. It's been quite a while since I've dabbled and as such I'm getting lost with where to put certain things
Essentially what I need the app to do is two fold. Firstly I need to present the user with the Twitch authentication page on first open so that they can authorise the app to use their twitch account/channel. Then I have a single screen with buttons on it. Each button calls a certain string, and what I need to do is pass that string into the users channel chat
I've got virtually all the code required to connect to the twitch API and generate the OAuth request, as well as code connecting to the channel and code to push commands from the buttons out to another endpoint. What I'm struggling with is the following:
Where do I put any of this code? Where am I putting the twitch OAuth request code etc? Do I create a separate Java class for it?
Once I've got the code in and working where is the data being stored and how do I then call it elsewhere? I guess this might get answered once I know where I'm actually putting the main code
Obviously the app will be used by multiple users so I assume I'll be creating variables for usernames, OAuth tokens etc and then will call them from other areas. I'm just unaware of how to get this done in the current Studio version and while I can find lots of references to what code to use, and plenty of examples of how to make code work I can't seem to find any info on where to actually put any code
I've abandoned android studio for now. no matter what I tried I can't get things working. switching over to another method of working using html/js/css and I've got so much further

Firebase RemoteConfig used for showing a message on app start

I am thinking of using RemoteConfig for these 2 purposes:
Have on the server a parameter minVersion of the app that should function. So for instance if v1.5 is broken and I release an update on Google Play as v1.6 I want to block access to 1.5 and older and force the user to update to 1.6 in order to use the app.
Have on the server, a parameter to store a message to display in the app. So for instance have a message like "We are having server maintenance, please wait a while". On app start, if the message parameter is not empty, show a dialog with it in the app.
Of course, in this case, on each app start I need to fetch the remote config values and check them.
Why use RemoteConfig? Because it's easy, it's free, it's convenient and I don't need to have another separate server for these 2 simple jobs.
So is this a valid use case?
Yes these are both valid cases.
For point 1, you can quite easily determine the users app version. I created a video detailing how to do it
https://youtu.be/McP11kcrMtk

Setup Google Analytics to trigger new session with dimension change

I've been getting weird results when running some custom segments over my app data in Google Anayltics. I have custom segments setup for specific app versions. e.g. Custom Segment -> Conditions -> App Version - exactly matches - 1.1.0
Using a secondary dimension of App Version on tables running against this segment, you would expect all the values to simply be 1.1.0. However my data also contains some values for 1.0.8 (my last build version before the minor update).
Reading the Google SDK docs on sessions (for iOS, but basically the same for Android) it states hits within 30 minutes are grouped into the same session. I'm guessing what is happening is people are opening the app, updating, and opening the new version all within 30 minutes, resulting in a single session with 2 different version numbers.
Is my guess about what is happening correct?
If so, is there a way to setup something within GA (server side) to trigger a new session when a specific dimension changes?
Or is it expected that you manually trigger a new session during every app launch?
1) yes.
2) if by "server-side" you mean "within the GA interface", then no.
3) Yes. dimensions are arbitrary data to give insight about visitors. They aren't meant to act as switches or the like. So you are expected to trigger a new session, because that's what it's there for.
And anyways, you should be triggering a new session start on each app open anyways. It's the equivalent of if a visitor were to go to a website, leave and then come back. In the web analytics world, reporters expect this to count as a new visit. Unfortunately, the way GA works, it doesn't count, because of that 30m timeout. And GA didn't offer a solution to this until Universal Analytics version (the one with ga() calls. There is no equivalent with _gaq.() calls, which is what most people still use :( ).

Piwik tracking in an android application

I want to do data analytics for my android application using Piwik.
In Piwik's documentation, they suggest using GitHub.
I got the Piwik API and download the following file:
https://github.com/piwik/piwik-java-tracking
which I don't know how to use.
What are the steps needed to get the data analysis using the Piwik working?
What should I do next?
I also would like to implement piwik tracking in my android app.
This is what I understood so far:
Unlike for iOS/MacOS applications, there is currently no SDK to help us out.
Piwik developers have a ticket opened in their bugtracker about this, which shows they're aware of the issue and willing to improve the situation, but it will take some time before this android tracking SDK is released.
At the moment, the Piwik team encourages android and Java developers to use the piwik-java-tracking library you mentioned. This is basically just a java wrapper for the web tracking API reference, which helps you to generate Tracking Request URLs to send to your Piwik instance.
This piwik-java-tracking project lacks documentation (there is none that I know of in Github), but there is javadoc in the java files.
Basically what you need to do to track an action is to:
Create a new instance of SimplePiwikTracker
Feed it with whatever values and parameters you wish to track using the various setters available
When you're done, get the URL using one of the methods defined in the PiwikTracker interface, depending of the type of "event" you want to track
Send a request to that URL to actually track your action into you Piwik instance.
This has several drawbacks:
If you need bulk tracking, you'll have to figure out a way of doing so. The web tracking API reference states you can use use a HTTP POST request containing a JSON object to do it.
It doesn't provide any help to handle the case where user is offline. If you need to, you'll have to find a way to cache your tracking request (in an sqlite database for example) and bulk send them when the user is back online.
You'll need to handle possible exceptions raised by network error for the tracking request, to make tat tracking does not interfere with your app normal behavior.
Be sure to read this article too. It gives you an overview of what you need to do to get up & running.
This is what I understood so far. I may update this answer as I progress in implementing piwik tracking in my own app.
Good luck.
Edit: I just noticed that Piwik released "Piwik SDK Android". There are some instruction on how to get this working in the project's wiki.

Storing 'pairing' information with Google TV 'Anymote Protocol'

I've implemented an application based off of the BlackJackRemote in the google-tv-samples (https://code.google.com/p/googletv-android-samples/source/browse/) and am having to pair the application to the GTV with every session. I've looked through the open source Google TV Remote application but it looks like it requires pairing each session as well. Is there something built into the AnymoteLibrary to retain paired sessions, or some pointers on implementing something like that myself?
My intuition is that I'll need to modify the AnymoteLibrary directly to get this functionality, but maybe it's already available and I've overlooked it.
Yes. It is possible. Infact The Google TV remote app does not make you pair everytime you open the app. Its only when the connection is lost that you need to pair again. The same can be replicated in the AnymoteLibrary. I am planning to release an update to the library for it soon.
The creator of Able Remote made a very nice library to handle this sort of thing:
https://github.com/entertailion/Anymote-for-Java (pure Java implementation of Anymote)
https://github.com/entertailion/Android-Anymote (Android project that uses said implementation)

Categories

Resources