Posted on

Clean status bar and Demo mode

Demo Mode for the Android System UI

[code language=”java”]
//enable demo
adb shell settings put global sysui_demo_allowed 1
// display time 12:00
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200
// Display full mobile data without type
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false
// Hide notifications
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false
// Show full battery but not in charging state
adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100
//exit
adb shell am broadcast -a com.android.systemui.demo -e command exit
[/code]

Posted on

google app index

Android Debug Bridge ADB

[code language=”java”]
$ ID="foo"
$ adb shell am start -a android.intent.action.VIEW \ -d "https://events.google.com/io2016/schedule?sid=$ID" \ com.google.samples.apps.iosched
[/code]

Activity

[code language=”java”]
@Override
protected void onCreate(Bundle savedInstanceStates) {
mClient = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
}

public void onStart() {
String url = "https://events.google.com/io2016/schedule?sid=" + sessionId;
Action action = Action.newAction(Action.TYPE_VIEW, title, url);
AppIndex.AppIndexApi.start(mClient, action);
}
[/code]

Activity. User came from Google

[code language=”java”]
//referrer string for Intents from Google Search in a browser
static final String Google_web_referrer = "https://www.google.com";
//referrer string for Intents from the Google app
static final String Google_app_referrer = "android-app://com.google.android.googlequicksearchbox/https/www.google.com";

public void onStart() {
String referrer = this.getReferrer().toString();
if (Google_web_referrer.equals(referrer) || Google_app_referrer.equals(referrer)) {
// user came from google
}
}
[/code]