기본 콘텐츠로 건너뛰기

Android, simple Fragment sample

* Main ---------------------------------------------------------- ***** xml <? xml version= "1.0" encoding= "utf-8" ?> < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" android :layout_width= "match_parent" android :layout_height= "match_parent" android :orientation= "vertical" xmlns: tools = "http://schemas.android.com/tools" > < LinearLayout android :orientation= "horizontal" android :layout_width= "match_parent" android :layout_height= "wrap_content" > < Button android :layout_width= "wrap_content" android :layout_height= "wrap_content" android :text= "fragment1" android :id= "@+id/button1" android :layout_weight= "1" android :onClick= "selectFrag" /...

Android, access gallery

private static final int REQUEST_PICK_IMAGE = 1 ; protected void ... { ... Intent photoPickerIntent = new Intent(Intent. ACTION_PICK ); photoPickerIntent.setType( "image/*" ); startActivityForResult(photoPickerIntent, REQUEST_PICK_IMAGE ); ... } @Override protected void onActivityResult( final int requestCode, final int resultCode, final Intent data) { switch (requestCode) { case REQUEST_PICK_IMAGE : if (resultCode == RESULT_OK ) { //handle image //data.getData } else { finish(); } break ; default : super .onActivityResult(requestCode, resultCode, data); break ; } }

Android, make Library Project

 ** make aar lib - Create New Project - gradle --  apply plugin : 'com.android.application' -- ->  apply  plugin :  'com.android.library' --  applicationId "xx.xxx.xxxx" -- ->  applicationId  "xx.xxx.xxxx" - Execute Gradle -- -> AAR file ([project name]/app/build/outputs/aar) ref :  http://flowarc.tistory.com/entry/Android-Studio%EC%97%90%EC%84%9C-%EB%82%98%EB%A7%8C%EC%9D%98-Library-%EB%A7%8C%EB%93%A4%EC%96%B4%EB%B3%B4%EA%B8%B0

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