{"id":5674,"date":"2011-05-10T12:17:52","date_gmt":"2011-05-10T12:17:52","guid":{"rendered":"http:\/\/fukata.org\/?p=5674"},"modified":"2017-08-11T22:51:08","modified_gmt":"2017-08-11T22:51:08","slug":"android-install-referrer","status":"publish","type":"post","link":"https:\/\/blog.fukata.org\/archives\/5674\/","title":{"rendered":"[Android]\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306e\u30ea\u30d5\u30a1\u30e9\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"
Google Analytics SDK for Android – Google Analytics for Mobile – Google Code<\/a><\/p>\n Google Analytics for Android\u3067\u5229\u7528\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306e\u30ea\u30d5\u30a1\u30e9\u60c5\u5831\u3092\u6d3b\u7528\u3057\u305f\u3044\u5834\u5408\u306e\u7c21\u5358\u306a\u8aac\u660e\u3068\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n \u3084\u308b\u3053\u3068\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u4eca\u56de\u306f\u65e2\u306b\u30a2\u30d7\u30ea\u304c\u5b58\u5728\u3059\u308b\u3082\u306e\u3068\u3057\u3066\u9032\u3081\u307e\u3059\u3002<\/p>\n <\/p>\n \u76ee\u6b21<\/p> \u307e\u305a\u306f\u3001\u30ea\u30d5\u30a1\u30e9\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308b\u70ba\u306eReceiver\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n \u5b9a\u7fa9\u3057\u305fExampleReceiver\u3067\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3059\u308b\u305f\u3081\u306b\u3001AndroidManifest.xml\u306b \u4e00\u3064\u6ce8\u610f\u3068\u3057\u3066\u3001ExampleReceiver\u5185\u3067\u30ea\u30d5\u30a1\u30e9\u60c5\u5831\u7b49\u3092\u30b5\u30fc\u30d0\u306b\u9001\u4fe1\u3057\u305f\u308a\u3059\u308b\u5834\u5408\u306f\u3001<\/receiver> <\/receiver><\/p>\n INSTALL_REFERRER\u306e\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u306fAndroid Market\u30a2\u30d7\u30ea\u3092\u7d4c\u7531\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u5834\u5408\u306b\u3057\u304b\u767a\u884c\u3055\u308c\u306a\u3044\u306e\u3067\u3001\u901a\u5e38\u901a\u308a\u30d1\u30bd\u30b3\u30f3\u304b\u3089\u30a2\u30d7\u30ea\u3092\u7aef\u672b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u5834\u5408\u306a\u3069\u306f\u767a\u884c\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n \u305d\u3046\u3044\u3046\u5834\u5408\u306b\u3001INSTALL_REFERRER\u30ec\u30b7\u30fc\u30d0\u30fc\u306e\u6319\u52d5\u3060\u3051\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u3092\u767a\u884c\u3057\u307e\u3059\u3002<\/p>\n \u8ffd\u8a18\uff1a2011.05.23<\/strong> \u8ffd\u8a18\uff1a2011.10.31<\/strong> \u30de\u30fc\u30b1\u30c3\u30c8\u30a2\u30d7\u30ea\u304c\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u306a\u3063\u3066\u304b\u3089INSTALL_REFERRER\u306e\u5024\u304c\u6b63\u5e38\u306b\u53d6\u308c\u306a\u304f\u306a\u3063\u305f\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n\n
BroadcastReceiver\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u306e\u5b9a\u7fa9<\/span><\/h2>\n
org.fukata.andorid.example.receiver.ExampleReceiver<\/span><\/h3>\n
\r\npackage org.fukata.android.example.receiver;\r\n\r\nimport java.net.URLDecoder;\r\n\r\nimport android.content.BroadcastReceiver;\r\nimport android.content.Context;\r\nimport android.content.Intent;\r\nimport android.util.Log;\r\n\r\npublic class ExampleReceiver extends BroadcastReceiver {\r\n\tstatic String TAG = ExampleReceiver.class.getSimpleName();\r\n\r\n\t@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\r\n\t\t\/\/ get referrer\r\n\t\tString referrer = URLDecoder.decode( intent.getStringExtra(\"referrer\") );\r\n\t\tLog.d(TAG, String.format(\"referrer: %s\", referrer));\r\n\t}\r\n\r\n}\r\n<\/pre>\n
AndroidManifest.xml\u306e\u4fee\u6b63<\/span><\/h2>\n
AndroidManifest.xml<\/span><\/h3>\n
\r\n< ?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n
\r\n
INSTALL_REFERRER\u3092\u64ec\u4f3c\u7684\u306b\u884c\u3046<\/span><\/h2>\n
\r\nadb shell am broadcast -a com.android.vending.INSTALL_REFERRER --es referrer hogehoge\r\n<\/pre>\n
\nandroid market\u306eURL\u306breferrer\u3068\u3044\u3046\u30ad\u30fc\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u3001com.android.vending.INSTALL_REFERRER\u306e\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u304c\u547c\u3070\u308c\u306a\u3044\u306e\u3067\u3001\u305d\u3082\u305d\u3082Receiver\u306e\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\u3068\u3044\u3046\u3053\u3068\u306b\u6c17\u3065\u304b\u305a\u591a\u304f\u306e\u6642\u9593\u3092\u7121\u99c4\u306b\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n
\n\u3010\u8cea\u554f\u3011Android Market\u306e\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3001INSTALL_REFERRER\u304c\u53d6\u5f97\u3055\u308c\u306a\u3044\u3002 – \u65e5\u672cAndroid\u306e\u4f1a | Google Groups<\/a><\/p>\n