Upgrade to Pro — share decks privately, control downloads, hide ads and more …

hyperion_android.pdf

7166bc2cbc462ab5fd1987a76d0fe709?s=47 takahirom
April 13, 2018
11

 hyperion_android.pdf

7166bc2cbc462ab5fd1987a76d0fe709?s=128

takahirom

April 13, 2018
Tweet

Transcript

  1. )ZQFSJPO"OESPJE UBLBIJSPN

  2. 荈ⴓחאְג ˖ UBLBIJSPN !OFX@SVOOBCMF  ˖ 劤せכ嬁「䃨峔 ׭׿ׄױ׋ַמ׹  ˖

    "OESPJEָ㥨ֹדׅկ ˖ "CFNB57ך"OESPJE،فٔ׾⡲׏גְתׅկ
  3. ˖ رغحؚ儗ך׫剣⸬חׇׁ׷ךٓ؎ـٓٔ ˖ 4UFUIPװ-FBL$BOBSZծ%FCVH"MUFSזו הずׄ ˖ سٗٙ٦חرغحًؚصُ٦׾鷄⸇דֹ׷ ˖ ♧א♧אךًصُ٦ָהג׮⤑ⵃ ˖

    䭁䓸䚍ָ֮׷
 (PPHMF"VUP4FSWJDFח״׶ծEFQFOEFODZ ח鷄⸇ׅ׷׌ֽדծ؝٦س׾箟꧊ׇ׆חر غحؚ堣腉׾鷄⸇דֹ׷ )ZQFSJPO"OESPJEהכ
  4. None
  5. )ZQFSJPO"OESPJEך 堣腉稱➜

  6. IZQFSJPOBUUS )ZQFSJPO"OESPJE ֶׅׅ׭䏝խӹ ˖ 7JFXך"UUSJCVUF׾鋅׵׸׷ ˖ &OBCMFזו׾ⴖ׶剏ִ׋׶׮⳿勻׷

  7. IZQFSJPONFBTVSFNFOU )ZQFSJPO"OESPJE ֶׅׅ׭䏝խӹӹӹӹӹ ˖ ;FQMJOך״ֲח7JFXה7JFXך꟦װ
 7JFXך㣐ֹׁ׾EQ⽃⡘ד鋅׷ֿהָ
 ⳿勻׷ ˖ ֿ׸ך׋׭חⰅ׸׷הְ׏ג׮
 葺ְ堣腉

    ˖ ♧䏝⢪ֲהֿ׸ז׃ד姻然זٖ؎، ؐز׾穈׭זֻז׶תׅ
  8. IZQFSJPOTIBSFEQSFGFSFODFT ֶׅׅ׭䏝խӹӹӹ ˖ 1SFGFSFODFך⦼׾⹛涸ח㢌刿דֹ׷
 堣腉

  9. ֶׅׅ׭䏝խӹ ˖ ،فٔך⹛ֹ׾⹛歗ה׃ג⥂㶷דֹ׷
 堣腉 IZQFSJPOSFDPSEFS

  10. IZQFSJPOEJTL ֶׅׅ׭䏝խӹ ˖ ،فٔךر٦ةر؍ؙٖزٔח⥂㶷
 ׁ׸ְגְ׷ؿ؋؎ٕ׾鋅׵׸׷堣腉

  11. IZQFSJPOQIPFOJY ֶׅׅ׭䏝խӹӹ ˖ ،فٔ׾ⱄ饯⹛׃זָ׵ر٦ةװ
 ٍؗحءُ׾⵴ꤐדֹ׷堣腉

  12. IZQFSJPODSBTI ֶׅׅ׭䏝խӹӹӹӹ ˖ ،فָٔ䓼ⵖ穄✪׃׋儗חծؙٓحءُ
 ؚٗ׾邌爙׃גֻ׸׷堣腉 ˖ 㖑㄂ח⤑ⵃדծ4FSWJDFהַד♶䠐ח
 ؙٓحءُ׃׋儗הַ׮ؙٓحءָُ
 鋅׵׸׷

  13. IZQFSJPOUJNCFS ֶׅׅ׭䏝խӹ ˖ 5JNCFSךָؚٗ鋅׵׸׷կ ˖ ؿ؍ٕة٦堣腉הַכזְךה
 ؔ٦غ٦ٖ؎ד鋅׋ְ䠬ָ֮׷

  14. ؟٦سػ٦ذ؍ךفؚٓ؎ٝ )ZQFSJPO$IVDL ˖ IUUQTHJUIVCDPN$PNNJU)ZQFSJPO$IVDL ֶׅׅ׭䏝խӹӹӹ ˖ KHJMGFMUDIVDL׾ㄎן⳿ׇ׷堣腉 ˖ ،فٔⰻד)UUQךؚٗ׾然钠דֹ׷

  15. فؚٓ؎ٝךꟚ涪ך
 ؝ٝزٔؽُ٦ز׮דֹ׉ֲ JTTVF♧鋮կIFMQXBOUFEָ㢳ְ

  16. )ZQFSJPO"OESPJE׾ 㼪Ⰵׅ׷♳ד عو׏׋䨽ה׉ך鍑寸瘻

  17. %BUB#JOEJOHך#JOEJOH欰䧭ך
 ؒٓ٦חז׷

  18. ˖ 3&"%.&ח剅ְג֮׷הֶ׶חEFQFOEFODZח)ZQFSJPO "OESPJE׾Ⰵ׸גؽٕس׃״ֲהׅ׷կ %BUB#JOEJOHך#JOEJOH欰䧭ך
 ؒٓ٦חז׷ debugImplementation 'com.willowtreeapps.hyperion:hyperion-core:0.9.22' debugImplementation ‘com.willowtreeapps.hyperion:hyperion-attr:0.9.22' ...

    ˖ ְא׮ךז׿ד䙫׏גְ׷ַⴓַ׷朐䡾חז׏׋
  19. ˖ )ZQFSJPOָ剑倜ך4VQQPSU-JCSBSZזו׾⢪׏גְ׷ךָ⾱㔓 ד׃׋կ %BUB#JOEJOHך#JOEJOH欰䧭ך
 ؒٓ٦חז׷ +--- com.willowtreeapps.hyperion:hyperion-core:0.9.21 | +--- com.willowtreeapps.hyperion:hyperion-plugin:0.9.21

    | +--- com.android.support:appcompat-v7:27.1.0 (*) | +--- com.android.support:recyclerview-v7:27.1.0 (*) | \--- com.google.dagger:dagger:2.15 | \--- javax.inject:javax.inject:1 ̒؝ٖ
  20. ["hyperion-core", "hyperion-attr", "hyperion-measurement", "hyperion- disk", "hyperion-recorder","hyperion-phoenix","hyperion-crash"].forEach { debugImplementation ("com.willowtreeapps.hyperion:$it:0.9.20"){ exclude

    group: 'com.android.support' exclude group: 'com.google.dagger' } } ·ͨ͸ɺҎԼͷΑ͏ʹόʔδϣϯΛݻఆͯ͋͛͠Δ͜ͱͰରԠͰ͖·͢ɻ
 (STAR_ZERO͞Μ͋Γ͕ͱ͏͍͟͝·͢) configurations.all { resolutionStrategy { eachDependency { DependencyResolveDetails details -> if (details.requested.group == 'com.android.support') { details.useVersion '26.1.0' } } } } %BUB#JOEJOHך#JOEJOH欰䧭ך
 ؒٓ٦חז׷ ⟃♴ך״ֲחꤐ㢩ׅ׷
 鷞ח)ZQFSJPOֲָתֻ⹛ַזֻז׷鿇ⴓָ֮׷ַ׮׃׸תׇ׿կ
  21. 傀㶷ךرغحًؚصُ٦ծ וֲׅ׷ַ

  22. 傀㶷ךرغحًؚصُ٦ծ
 וֲׅ׷ַ ׅדח،فٔחرغحًؚصُ٦ָ㹋鄲ׁ׸גְ׷㜥さծוך ״ֲח㼎䘔ׅ׷ַ ˖ 傀㶷ךرغحًؚصُ٦כ嶊ׅ ˖ 荈ⴓד1MVHJO׾⡲׷ ˖

  23. 傀㶷ךرغحًؚصُ٦׾ Ꟛֻ׋׭ח荈ⴓד1MVHJO׾⡲׷ ٌآُ٦ٕ׾⡲׶EFQFOEFODZה"VUP4FSWJDF׾BOOPUBUJPO1SPDFTTPSד 䭷㹀 annotationProcessor "com.google.auto.service:auto-service:1.0-rc4" implementation 'com.willowtreeapps.hyperion:hyperion-plugin:0.9.22' ˖ ءٝفٕחًصُ٦׾鷄⸇ׅ׷⢽

  24. 傀㶷ךرغحًؚصُ٦׾ Ꟛֻ׋׭ח荈ⴓד1MVHJO׾⡲׷ @AutoService(Plugin.class) class HelloWorldPlugin extends Plugin { @Override public

    PluginModule createPluginModule() { return new HelloWorldPluginModule(); } } class HelloWorldPluginModule extends PluginModule { @Override public View createPluginView(@NonNull LayoutInf @NonNull ViewGroup parent) { final TextView textView = new TextView(pare textView.setText("Hello Hyperion Plugin"); textView.setTextSize(50); textView.setOnClickListener(new View.OnClic @Override public void onClick(View v) { Log.d("Hyperion", “goto debugmenu") ҎԼͷΑ͏ͳΫϥεΛ࡞Δɻ
  25. @AutoService(Plugin.class) class HelloWorldPlugin extends Plugin { @Override public PluginModule createPluginModule()

    { return new HelloWorldPluginModule(); } } class HelloWorldPluginModule extends PluginModule { @Override public View createPluginView(@NonNull LayoutInflater layoutInflater, @NonNull ViewGroup parent) { final TextView textView = new TextView(parent.getContext()); textView.setText("Hello Hyperion Plugin"); textView.setTextSize(50); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Hyperion", “goto debugmenu"); } }); return textView; } } "VUP4FSWJDF،ظذ٦ءّٝ׾⢪ֲ
  26. @AutoService(Plugin.class) class HelloWorldPlugin extends Plugin { @Override public PluginModule createPluginModule()

    { return new HelloWorldPluginModule(); } } class HelloWorldPluginModule extends PluginModule { @Override public View createPluginView(@NonNull LayoutInflater layoutInflater, @NonNull ViewGroup parent) { final TextView textView = new TextView(parent.getContext()); textView.setText("Hello Hyperion Plugin"); textView.setTextSize(50); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Hyperion", “goto debugmenu"); } }); return textView; } } 1MVHJOؙٓأ׾⡲׶׉ֿד1MVHJO.PEVMF׾⡲䧭
  27. @AutoService(Plugin.class) class HelloWorldPlugin extends Plugin { @Override public PluginModule createPluginModule()

    { return new HelloWorldPluginModule(); } } class HelloWorldPluginModule extends PluginModule { @Override public View createPluginView(@NonNull LayoutInflater layoutInflater, @NonNull ViewGroup parent) { final TextView textView = new TextView(parent.getContext()); textView.setText("Hello Hyperion Plugin"); textView.setTextSize(50); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Hyperion", “goto debugmenu"); } }); return textView; } } 1MVHJO.PEVMFؙٓأד7JFX׾⡲׏ג鵤ׅ
  28. @AutoService(Plugin.class) class HelloWorldPlugin extends Plugin { @Override public PluginModule createPluginModule()

    { return new HelloWorldPluginModule(); } } class HelloWorldPluginModule extends PluginModule { @Override public View createPluginView(@NonNull LayoutInflater layoutInflater, @NonNull ViewGroup parent) { final TextView textView = new TextView(parent.getContext()); textView.setText("Hello Hyperion Plugin"); textView.setTextSize(50); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Hyperion", “goto debugmenu"); } }); return textView; } } 1MVHJO.PEVMFؙٓأחכ
 葿ղ⤑ⵃזًاحسָ欰ִגְ׷ךדⵃ欽׃ג׫׷ה葺ׁ׉ֲ
  29. ،فٔⰻד⢪ֲ1MVHJO׾⡲׷ ㉏겗挿 EFCVHTPVSDF TFU ผϞδϡʔϧ !"VUP4FSWJDFΛ ࢖͏৔߹ º ͳ͔ͥ(PPHMF "VUP4FSWJDF͕


    ࢀরͰ͖ͳ͍ ˚
 ΞϓϦ಺ͷΫϥε͕ ࢀরͰ͖ͳ͍ ،فٔ欽ך فؚٓ؎ָٝ鷄⸇ָꨇ׃ְ
  30. فؙٕٔ⳿׃ג ⥜姻דֹת׃׋

  31. 1MVHJOָ
 䩛⹛ד鷄⸇דֹ׷״ֲחז׶ת׃׋ PluginSource source = Hyperion.getPluginSource(); class MyPluginSource implements PluginSource

    { private PluginSource originalPluginSource; MyPluginSource(PluginSource originalPluginSource) { this.originalPluginSource = originalPluginSource; } @Override public Set<Plugin> getPlugins() { final HashSet<Plugin> plugins = new HashSet<>(); plugins.addAll(originalPluginSource.getPlugins()); plugins.add(new HelloWorldPlugin()); return plugins; } } Hyperion.setPlugins(new MyPluginSource(source)); 1MVHJO4PVSDF׾XSBQEFMFHBUFׅ׷
  32. فؚٓ؎ٝ⡲׷ך꬗⦜

  33. ءٝفٕח،؎ذي׾鷄⸇ׅ׷ فؚٓ؎ٝ׾⡲׶ת׃׋

  34. )ZQFSJPO4JNQMF*UFN app/src/debug/java/.../DebugApp.java // Extends your main Application classs public class

    DebugApp extends App { @Override public void onCreate() { super.onCreate(); final SimpleItem item = new SimpleItem.Builder("all: this is the title") .text("this is the text") .image(R.drawable.ic_list_black_24dp) .clickListener(new View.OnClickListener() { @Override public void onClick(View v) { Toast.makeText(App.this, "click",Toast.LENGTH_SHORT).show(); } }) .build(); SimpleItemHyperionPlugin.addItem(item); 知⽃ח،؎ذي׾鷄⸇דֹ׷׌ֽ IUUQTHJUIVCDPNUBLBIJSPN)ZQFSJPO4JNQMF*UFN )ZQFSJPO"OESPJEך3&"%.&ח׮鯹׶ת׃׋ أة٦ֶ격ְ׃תׅ
  35. Ⱗ⡤涸חծ
 ו׿ז㢌刿׾׃׋׵ְְַ

  36. 㼪Ⰵ1VMM3FRVFTU %SPJE,BJHJⰕ䒭،فٔדך㼪Ⰵ13דׅկ IUUQTHJUIVCDPN%SPJE,BJHJDPOGFSFODFBQQQVMM

  37. תה׭ )ZQFSJPO"OESPJEְְ䠬ׄזךדծⰅ׸ג׫ת׃׳ֲ فؚٓ؎ٝ׾荈ⴓד⡲׏ג׫ת׃׳ֲ %BUB#JOEJOHדؒٓ٦ָ⳿׋׵⣛㶷ꟼ⤘׾毟׏ג׫ת׃׳ֲ 傀㶷ךرغحًؚصُ٦ח굲לׅהֹכ)ZQFSJPO4JNQMF*UFN׾
 Ⰵ׸ג׫ת׃׳ֲ أة٦אֽגֻ׌ְׁ