I'm trying to figure out how can I apply this guide to my code and this SO answer, precisely:
A session begins to time out when an app is moved to the background,
but you have the option to extend that session by logging the
extend_session parameter (with a value of 1) on events logged while
the app is in the background.
This is my code (which I want to use on events, when my service is running and activities are on pause / stop):
Bundle params = new Bundle();
params.putInt("extend_session", 1);
firebaseAnalytics.logEvent("app_in_background", params);
The event is custom, because default one doesn't suite my need.
Long story short, I want to see how much time (average) the service is running and possibly having this data listed in Where are your users engaged? table (Firebase console).
What I want to achieve is: how much my users are engaged while using my app service ?
Am I using the correct approach ?
Related
I have hit events to google analytics using measurement protocol parameters from java.
worked fine more than 5 months.
but within a week event hits only appear in real time data, but not in reports.
JS api hits already works fine and no issue.
i didn't do any change.
and no any events hits limit exceed notification or filters.
i have updated client id and parameter values. and tested more than one week.
no any improvement.
Properties p = new Properties();
p.setProperty("v", "1");
p.setProperty("tid", "UA-#########");
p.setProperty("cid", "######.####");
p.setProperty("t", "event");// hit type
p.setProperty("ec", "test category");// event category
p.setProperty("ea", "test action");// event action
p.setProperty("el", "test label");// event label
p.setProperty("ev", "1");// event value
sendEvent(p);//http post request
I know that returning a value from a JWSapp to the "calling" page cannot be done.
However, I use this JWSapp to get user ID from its biometric information.
The idea is that when you try to login, a button allows to launch the JWSapp that will deal with the biometric tasks and then return the user's idea.
Still, as I said, from a JWSapp I cannot send back the id to auto-complete the field. I found this post: Returning a value from a java web start application but I really need to keep the JWS (external constraints)...
So there's my question: is there any workaround to get the id back?
Thank you in advance :)
I am working on app running on two tablets, which have two type of logins. Customer and Shopkeeper, it will run on two tabs at same time. I am getting tabs device id and saving it. because it can't be run on any other tablet without registered tablets.The issue is that after login when I go on main screen, when i enter number from any tablets, the next screen must be changed on both tablets. I am not getting the idea how to operate two tabs from any one of them.Can you help me to get this idea. any help will be appreciated.
I have 2 separate options here :
A. Use CouchDB.
Couch DB has this functionality to sync data between client and server.
Steps :
Tablet1 enter a value
Value saved in tablet1 CouchDB. (You can use something like couchbase-android)
Data synced from client COUCHDB to Server CouchDB ( you can use Cloudant here )
Data synced from Server CouchDB to client CouchDB in the Tablet1
Tablet2 use a listener to listen to record change in the database
Tablet2 change its state based on the record change.
B. Use Notification Server
Tablet1 enter a value
Tablet1 send message to Notification Server, indicating the changes
Notification Server send notification to Tablet2
Tablet2 use Notification Listener to listen to all notification
Tablet2 change it state based on data contained in the notification message.
I'm in little trouble with designing GWT application. I am trying to develope RIA app (with just one main widget, lets call it Main). First, user must be logged. Here's my way to do that, but it does have a problem, you'll see.
Show login components on root panel
If login was successfull (checks database), show Main widget
Widget is added to root panel
Everything works, but when you press Refresh it shows again login components ... It all happens in onModuleLoad method.
How should I redesign this logic? I'd like to let user logged (that means RootPanel will hold Main widget) for certain amount of time.
http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
How to remember logins
Our login
system so far misses a useful feature:
For now it requires users to log in
again every time.
We can use Cookies to allow the user's
web browser to 'remember' the login.
In GWT, to set the cookie (which you'd
do right after your GWT code receives
the response as we did in the previous
code fragment):
String sessionID = /*(Get sessionID from server's response to your login request.)*/;
final long DURATION = 1000 * 60 * 60 * 24 * 14; //duration remembering login. 2 weeks in this example.
Date expires = new Date(System.currentTimeMillis() + DURATION);
Cookies.setCookie("sid", sessionID, expires, null, "/", false);
Now you can run the following code
right after your !EntryPoint begins
execution:
String sessionID = Cookies.getCookie("sid");
if ( sessionID != null ) checkWithServerIfSessionIdIsStillLegal();
else displayLoginBox();
Remember - you must never rely on the sessionID
sent to your server in the cookie
header ; look only at the sessionID
that your GWT app sends explicitly in
the payload of messages to your
server.
I'm not sure what how your GWT app implemented communication with the login service, but if you want to see another example, I followed the example here:
http://code.google.com/webtoolkit/doc/latest/tutorial/appengine.html#user
While it uses the Google App Engine as the backend authentication service, I think it's generic enough to be adapted to any server that supports the GWT RPC server side and has authentication services.
You need some kind of server-side support to do it.
For example, when user logs in, mark it in the server-side session. In onModuleLoad(), call the server to check whether user is logged in before showing the login form.
Other problems related to pressing Refresh can be solved with history tokens.
I know that the SMS content provider is not part of the public API (at least not documented), but if I understand correctly it's still possible to use many of the SMS features as long as you know how to use the API(?).
E.g it's pretty straightforward to insert an SMS into your inbox:
ContentValues values = new ContentValues();
values.put("address", "+457014921911");
contentResolver.insert(Uri.parse("content://sms"), values);
Unfortunately this does not trigger the standard "new-SMS-in-your-inbox" notification. Is it possible to trigger this manually?
Edit: AFAIK the "standard mail application (Messaging)" in Android is listening for incoming SMSes using the android.permission.RECEIVE_SMS permission. And then, when a new SMS has arrived, a status bar notification is inserted with a "special" notification id.
So one solution to my problem (stated above) could be to find, and send the correct broadcast intent; something like "NEW SMS HAS ARRIVED"-intent.
Edit: Downloaded a third party messaging application (chompsms) from Android market. This application satisfies my needs better. When i execute the code above the chompsms notice the new sms and shows the "standard status bar notification". So I would say that the standard Android Messaging application is not detecting sms properly? Or am I wrong?
Unfortunately the code responsible for these notifications is hidden in the messaging application. The class MessagingNotification has a static method updateAllNotifications that you could call using a PathClassLoader and reflection:
PathClassLoader c = new PathClassLoader("/system/app/Mms.apk", getClassLoader());
Class.forName("com.android.mms.util.ContactInfoCache", true, c)
.getMethod("init", Context.class).invoke(null, context);
Class.forName("com.android.mms.transaction.MessagingNotification", true, c)
.getMethod("updateAllNotifications", Context.class).invoke(null, context);
This is obviously a very bad idea for several reasons but I can't think of another way to do what you described.
Could you trigger a PUSH notification after the SMS?
Thread: Does Android support near real time push notification?
Maybe you should replace
content://sms
with
content://sms/inbox