기본 콘텐츠로 건너뛰기

4월, 2016의 게시물 표시

Google Analytics v3, INSTALL_REFERRER

AndroidManifest.xml < service android :name= "com.google.analytics.tracking.android.CampaignTrackingService" /> < receiver android :name= "com.google.analytics.tracking.android.CampaignTrackingReceiver" android :exported= "true" > < intent-filter > < action android :name= "com.android.vending.INSTALL_REFERRER" /> </ intent-filter > </ receiver > https://developers.google.com/analytics/devguides/collection/android/v3/campaigns#google-play-implement

Android, Spinner, DropDownList

final Spinner fontSizeSpinner = (Spinner)dialog.findViewById(R.id. dialog_setting_fontsize_spinner ); { // font size fontSizeTitle.setText(act.getString(R.string. setting_fontsize_title ).toString()); List<String> list = new ArrayList<String>(); list.add(act.getString(R.string. setting_fontsize_3_label )); list.add(act.getString(R.string. setting_fontsize_2_label )); list.add(act.getString(R.string. setting_fontsize_1_label )); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout. simple_spinner_item , list); dataAdapter.setDropDownViewResource(android.R.layout. simple_spinner_dropdown_item ); fontSizeSpinner.setAdapter(dataAdapter); }

AndroidStudio, Gradle, apk name debug/release

android { ... buildTypes { debug { ... } release { ... } applicationVariants.all { variant -> variant.outputs.each { output -> def apkName = "" def formattedDate = new Date().format( 'yyyyMMdd' ) if (variant.buildType.name == "release" ){ apkName = "AppName_" + variant.versionName + "_" + formattedDate + ".apk" } else { apkName = "AppName_dev" + variant.versionName + "_" + formattedDate + ".apk" } output.outputFile = new File(output.outputFile.parent, apkName) } } }

Android Studio, debug/release. values

string value. debug/release ------------------------------------------------ AndroidManifest.xml ... < meta-data android:name = "com.pkg.myp" android:value = "@string/a_string" / > ... src/debug/res/values/aaa.xml ... < string name = "a_string" > debugValue < / string > ... src/release/res/values/aaa.xml ... < string name = "a_string" > releaseValue < / string > ... src/main/res/values/aaa.xml < ?xml version = "1.0" encoding = "utf-8" ? > < resources xmlns:tools = "http://schemas.android.com/tools"   tools:ignore = "MissingTranslation" > <!-- translate err when make apk. add MissingTranslation --> ... ------------------------------------------------------------------------------

Android, GoogleMap V2, custom InfoWIndow

map.setInfoWindowAdapter( new GoogleMap.InfoWindowAdapter() { @Override public View getInfoWindow(Marker arg0) { //use custom window include infoWindow style. return null ; } @Override public View getInfoContents(Marker arg0) { //call when getInfoWindow returns null //use custom window with default infoWindow style. return null ; } });