Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

少し幸せになる技術

926 views

Published on

DroidKaigi 2017 3/9 18:00~
Kameron

Published in: Technology
  • Be the first to comment

  • Be the first to like this

少し幸せになる技術

  1. 1. DroidKaigi 2017 3/9 18:00~ Kameron
  2. 2. 🎉🎉🎉
  3. 3. • • Kotlin • •
  4. 4. • 2.3 Eclipse • • 
 • 
 • • •
  5. 5. • • Android • Android •
  6. 6. • • Android Studio • Build.gradle • • OS, • ProGuard • Google Play Console
  7. 7. Android Studio
  8. 8. Android Studio (ver2.3) • Jetbrains IDE • Eclipse • ADT 
 
 Android Studio
  9. 9. IDE 
 • Android Studio 
 Find Action • Mac: ⌘ ⇧ A • Windows: Ctrl Shift A
 • • Keymap
  10. 10. 
 • Android Studio 
 Search Everywhere • Mac: ⇧ ⇧ • Windows:Shift Shift •
  11. 11. 
 • Save Actions
  12. 12. • Plugin ADB IDEA
 

  13. 13. public class CalcUtil {
 public static int mod(int x, int y) {
 if (y == 0) {
 throw new IllegalArgumentException("y != 0");
 }
 return x % y;
 }
 }
  14. 14. public class CalcUtilTest {
 
 @Test
 public void 余りのテスト() { 
 Assert.assertThat(3,Is.is(CalcUtil.mod(11, 4)));
 }
 }
  15. 15. Build.gradle
  16. 16. Build.gradle • • AndroidManifest 
 Build.gradle • AndroidManifest: 
 • Build.gradle:
  17. 17. • • • Suffix
  18. 18. buildTypes {
 release {}
 debug {
 applicationIdSuffix ".debug"
 }
 }
 productFlavors {
 demo {
 applicationIdSuffix ".demo"
 }
 full {
 applicationIdSuffix ".full"
 }
 }
  19. 19. • 
 • BuildConfig
  20. 20. buildTypes {
 release {
 buildConfigField "String", "ENDPOINT", ""https://hoge.com" "
 }
 debug {
 applicationIdSuffix ".debug"
 buildConfigField "String", "ENDPOINT", ""https://localhost" "
 }
 }
 
 productFlavors {
 demo {
 buildConfigField "boolean", "DEMO", "true"
 applicationIdSuffix ".demo"
 }
 full {
 buildConfigField "boolean", "DEMO", "false"
 applicationIdSuffix ".full"
 }
 }
  21. 21. buildTypes {
 release {
 buildConfigField "String", "ENDPOINT", ""https://hoge.com" "
 }
 debug {
 applicationIdSuffix ".debug"
 buildConfigField "String", "ENDPOINT", ""https://localhost" "
 }
 }
 
 productFlavors {
 demo {
 buildConfigField "boolean", "DEMO", "true"
 applicationIdSuffix ".demo"
 }
 full {
 buildConfigField "boolean", "DEMO", "false"
 applicationIdSuffix ".full"
 }
 }
  22. 22. • 
 
 • src/demoDebug/ • src/debug/ • src/demo/ • src/main/
  23. 23. • • app/src/main/res/values/strings.xml 
 app/src/debug/res/values/strings.xml 
 • <string name=“app_name">Debug</string>
  24. 24. • : • • • • : ON/OFF • / : ON/OFF
  25. 25. def major = 1
 def minor = 0
 def patch = 0
 def build = 0
 
 android {
 defaultConfig {
 versionCode major * 10000 + minor * 1000 + patch * 100 + build
 versionName "${major}.${minor}.${patch}"
 }
 } 

  26. 26. • build.gradle • Private Repository • CI • • git
  27. 27. signingConfigs {
 release {
 storeFile file(“./filepath”)
 keyAlias “test”
 storePassword “test”
 keyPassword “test”
 }
 }
  28. 28. • keystore.properties storePassword=myStorePassword
 keyPassword=mykeyPassword
 keyAlias=myKeyAlias
 storeFile=myStoreFileLocation
  29. 29. • build.gradle signingConfigs {
 debug {
 def keystorePropertiesFile = rootProject.file("keystore.properties")
 def keystoreProperties = new Properties()
 keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 
 keyAlias keystoreProperties['keyAlias']
 keyPassword keystoreProperties['keyPassword']
 storeFile file(keystoreProperties['storeFile'])
 storePassword keystoreProperties['storePassword']
 }
 }
  30. 30. • •
  31. 31. Log • JakeWharton/timber • Debug • 
 if (BuildConfig.DEBUG) {
 Timber.plant(Timber.DebugTree())
 }
 Timber.d(“test”,”test”)
  32. 32. • facebook/stetho Chome • • mitmproxy • • python endpoint
  33. 33. • square/leakcanary • Application 

  34. 34. Log Unit Test • Log ClassLoader Log 
 app/src/test/java/android/util/Log.java public class Log {
 public static int v(String tag, String msg) { return 0; }
 public static int v(String tag, String msg, Throwable tr) { return 0; }
 public static int d(String tag, String msg) { return 0; }
 public static int d(String tag, String msg, Throwable tr) { return 0; }
 public static int i(String tag, String msg) { return 0; }
 public static int i(String tag, String msg, Throwable tr) { return 0; }
 public static int w(String tag, String msg) { return 0; }
 public static int w(String tag, String msg, Throwable tr) { return 0; }
 public static int w(String tag, Throwable tr) { return 0; }
 public static int e(String tag, String msg) { return 0; }
 public static int e(String tag, String msg, Throwable tr) { return 0; }
 }
  35. 35. ProGurad
  36. 36. ProGuard • • • public class MainActivity extends c {
 private TextView m;
 public MainActivity() {}
 protected void onCreate(Bundle var1) {
 super.onCreate(var1);
 this.setContentView(2130968603);
 this.m = (TextView)this.findViewById(2131427415);
 this.m.setText("hello world");
 }
 }
  37. 37. 64k • 64k • ProGuard • Multidex 64k
  38. 38. ProGuard • ProGuard • • a,b • 
 • Keep
  39. 39. ProGuard • ProGuard • • buildTypes {
 debug {
 minifyEnabled true
 useProguard false
 proguardFiles getDefaultProguardFile('proguard- android.txt'),
 'proguard-rules.pro'
 }
 }
  40. 40. • mapping.txt 
 Google Play Console
  41. 41. OS,
  42. 42. OS, •
  43. 43. • • • • Support Library
  44. 44. • Android 6.0 • • 
 hotchemi/PermissionsDispatcher
  45. 45. Google Play Console
  46. 46. Google Play Console • Google Play Google • Android 
 • Amazon Store au • Google Play Console Play
  47. 47. Android • • • • •
  48. 48. • • • •
  49. 49. • 
 • Google Play Console
  50. 50. • Beta 10
  51. 51. • Android Studio… • Build.gradle • • Google Play Console • • ProGuard
  52. 52. • • • DroidKaigi/conference-app-2017 • JakeWharton/u2020 • Android Developers

×