Android App Help - android

I made a thread similar to this, but I want to elaborate.
Essentially I want to make an app that can be started up, run in the background and will receive messages from a server (the server is a linux server up that currently sends out messages with updates on a system I have to know about) and then give a notice to the person about the message and just kinda stay passively in the back unless it's closed down entirely. I am very new to Android and I have a similar function up on the web, but a web app is required. Any suggestions on what I should read first or anyone know a good tutorial of something similar?
Thanks

Start there : http://developer.android.com/guide/topics/fundamentals/services.html

start reading about services , (services are working in background ) ; and after , read about notifications in android :
refer this two links :
tuto services 1
tuto services 2
tuto services 3

Related

I am unable to include "code" into this system as part of a question. Anything I put into the "Body"

For example, I only have one "body" but have a description like:
I can understand that a non-BLE device will not respond to the BLE Client device (Android) using StartDiscovery but should respond to a Scan request. I believe that the AdaFruit is responding to a discovery event because I am getting discovery responses to devices within range with the Android device app in the Settings/Connections/Bluetooth display. This includes the Adafruit BLE device. Again, I believe this means that the problem is on the Android side. I have searched everything I can find but most of the information I get is years old. I have focused in on something called LeScanCallback and/or LeDeviceListAdapter as the potential problem. I can't even tell is my callback is being triggered. Any help would be GREATLY appreciated!
but when I try to insert a code block this system won't let me post the question. I have seen many other questions where the poster actually has different input blocks for the manifest, xms, and main Java script, but I don't see anything like that.
I didn't realize I had the formatting wrong. I needed to manually insert 4 spaces in front of every line, and use the "Code here". That will teach me for reading the instructions too fast! Thanks for the comment from Morrison Chang that put me in the right direction.

Waiting icon on Ionic mobile app

Its been frustrating since we tried many times but failed to resolve the issue on our mobile app (build on Ionic Framework + html5 + AngularJS). When our mobile app is activated, it tries to display data for selection (service layer built on Python), but somehow, the waiting icon is displayed for a long time. Due to confidentiality issue, I cannot display the mobile app code here, but I hope someone how share their experience on this issue. I am attached a copy of the screen shot for reference. enter image description here. All positive suggestions are welcome. Thanks.
Mobile app waiting icon issue
Your question is not very clear but from what I understood you can hide the loader in your callback function. I have assumed you are using promise/callback
$ionicLoading.show();
var datacall=//your call to a data service function using $http to your backend
datacall.$promise.then(function(success){$ionicLoading.hide()},function(err){$ionicLoading.hide()});
Let me know if you want the entire code

Detect application is being uninstalled in lollipop devices

I would like to know which users have uninstalled my application so that I can ask them for a feedback to improve the app. Hence, I would like to detect when the user has initiated the uninstallation process on my app.
One of the older solutions on StackOverflow had the following steps:
List< ActivityManager.RunningTaskInfo > taskInfo = am.getRunningTasks(MAX_PRIORITY);
String activityName = taskInfo.get(0).topActivity.getClassName();
if (activityName.equals("com.android.packageinstaller.UninstallerActivity")) {
// do whatever is needed
Since Lollipop, getRunningTasks has been deprecated. So how can com.android.packageinstaller.UninstallerActivity activity be detected without getRunningTask?
Alternatively is there any other method to detect uninstallation process has been started on my app? Using getAppTask probably?
Apparently you wont be able to do this, you will have to rely on something called silent notification.
What we did was we sent notification every 3 days or whatever frequency you want.
On the client side as soon as a notification is received we hit a network call which mark NotificationReceived for the client. Now since notification are not full proof we assumed a threshold of 2/3 missed notification as uninstall event. And for the client we have this counter above decided threshold we contacted them for feedback.
Also no one will be willing to fill your form at the time of uninstallation as user has already decided to uninstall your application.
Read these 2 questions and answers:
native solution
GCM solution
As I know you have to mix the two. Read the limitations of first solution. You have to confirm uninstallation event of the first solution with the second solution for a complete implementation.
Hopefully, this solution will work for you. It helps you understand the reasons for your app uninstalls, reduce the uninstall rate using a powerful predictive engine and also get app Re-installs through a unique actionable channel (Android version 4.0 and above).
Just set a variable named appLastPresent for every user in the server-side and update that variable every day by calling an API using WorkManager's PeriodicWorkRequest. Also set installedDate variable when the user installs the app.
Now set up a chron job on the server side to check if the difference between installedDate and appLastPresent is greater than 7 days. Then send the user an email or message enquiring for issues or feedback, if it is greater.
NB: User can be offline for 7 days. Therefore only send email enquiring like why you are not using the app, if uninstalled please let us know why

Android Wear: getDataItems returns 0 items

Here is a big problem that i simply don't know whats going on...
I have an app that stores Data in data API. The mobile app is aroudn the play store for some time and I decided to make a app for wearable.
My problem is: when the user install the wearable app for the first time (via Google Play), it need to load the data from the DataApi. But it simple returns 0 itens!
DataItemBuffer dataItems = Wearable.DataApi.getDataItems(mGoogleApiClient).await();
Observations:
GoogleApiClient IS CONNECTED
The Wearable receives the onDataChanged from WearableListenerService and this part is working fine.
I've already tested with .setResultCallback but results still the same.
I have two copmuter for developments, one is one my work and another is on my home.
In my tests, I DELETE the emulator and create a new one, to simulate a "new device beeing connected for the first time".
DataAPI says that the data is synchronzed to all devices but is seems not be working like that. How to solves this? Any workaround? SOMEONE HELP =(
It seems i found the solution for this problem. As I mentioned i have two computers for development, so, 2 development keys.
My mobile app was installed using the "A" computer's key and the wearable was using the "B" one. So, to solve this problem, when start developing always remember to re-run the mobile and wearable app from the same computer to your devices.

Google Tag Manager for Android

I implement Google Tag Manager on my project .When i work on emulator all events come faster in Google anlyatics account shown which page open,but problem is that when i use in real device its taking more time to show the events,its taking around 2-5 mins.
I am using like that can any tell me why its not working in real device.
& also can any one help me out how to implement E commerce tracking in android app.
DataLayer dataLayer = TagManager.getInstance(context).getDataLayer();
dataLayer.push(DataLayer.mapOf("event", "openScreen",
"screenName", "Home Screen"));
GoogleAnalytics.getInstance(context).setLocalDispatchPeriod(5);
I'm not entirely sure, since I don't develop your Android, but for iOS using Google Tag Manager (and Google Analytics for that matter) the mobile platform is not pushing events in realtime, but they batch the data and send them every other minute or so. For me the emulator in iOS does the same, i.e. it sends data every other minute and the same on device. Maybe the emulator in Android is different in this regard, but I believe that mobiles do not send data in realtime at all, but batches a chunk of data and send it at the same time.
I don't think there is any way to go around this. Correct me if I'm wrong though, but that's what I read somewhere in the documentation. Can't seem to find the reference though.

Categories

Resources