Posted on Leave a comment

google app index

Android Debug Bridge ADB

$ 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

Activity

@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);
}

Activity. User came from Google

//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
  }
}
Posted on Leave a comment

Android Studio preferences

Colors, code styles, etc

Path MacOs

~/Library/Preferences/AndroidStudio[version]/colors/thefile

My colors:

<scheme name="_@user_Default" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
  <metaInfo>
    <property name="created">2017-10-25T11:02:44</property>
    <property name="ide">AndroidStudio</property>
    <property name="ideVersion">3.0.0.17</property>
    <property name="modified">2017-10-25T11:08:27</property>
    <property name="originalScheme">Default</property>
  </metaInfo>
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
  <attributes>
<option name="CLASS_NAME_ATTRIBUTES">
      <value>
<option name="FOREGROUND" value="6496dc" />
      </value>
    </option>
<option name="INTERFACE_NAME_ATTRIBUTES">
      <value>
<option name="FOREGROUND" value="32b432" />
      </value>
    </option>
  </attributes>
</scheme>