Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2014.10.28 - Android Taipei - Hi AndroidAnnotat...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yes
October 28, 2014
Programming
100
1
Share
2014.10.28 - Android Taipei - Hi AndroidAnnotations
A brief sharing about AndroidAnnotations at Android Taipei.
Yes
October 28, 2014
More Decks by Yes
See All by Yes
2014.04.30 - Android Taipei - Data & PracSong
namejoshua
0
94
Other Decks in Programming
See All in Programming
How to stabilize UI tests using XCTest
akkeylab
0
150
PHPで TLSのプロトコルを実装してみる
higaki_program
0
610
OTP を自動で入力する裏技
megabitsenmzq
0
130
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
130
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
490
20260315 AWSなんもわからん🥲
chiilog
2
180
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
290
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
290
安いハードウェアでVulkan
fadis
1
850
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
200
Understanding Apache Lucene - More than just full-text search
spinscale
0
150
KagglerがMixSeekを触ってみた
morim
0
360
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
240
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.4k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
510
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
280
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
91
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
300
Transcript
Hi! AndroidAnnotations 㥮疍 yes ! 2014.10.28 Android Taipei @ PicCollage
Story 1
public class MainActivity extends Activity { ! onCreate() { setContentView(R.id.activity_main);
} ! }
public class MainFragment extends Fragment { onCreateView() { return inflater.inflate(R.layout.fragment_main,
container, false); } ! }
public class MainFragment extends Fragment { onCreateView() { View view
= inflater.inflate(R.layout.fragment_main, container, false); ! TextView textView1 = view.findViewById(R.id.textview1); TextView textView2 = view.findViewById(R.id.textview1); TextView textView3= view.findViewById(R.id.textview1); TextView textView4 = view.findViewById(R.id.textview1); ! textView1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); return view; } ! }
public abstract class AbstractFragment extends Fragment { protected abstract int
setRootViewId(); int[] setOnClickListenerViews() {} } public class MainFragment extends AbstractFragment implement View.OnClickListener @Override protected int setRootViewId() { return R.layout.fragment_main } @Override int[] setOnClickListenerViews() { return new int[] { R.id.button_ok, R.id.button_no } } ! @Override public void onClick(View v) { switch (v.getId) { case R.id.button_ok: … } }
Story 2
Android Studio ;
support-annotations
None
(;ƅшƅʣ
@Efragment(R.layout.fragment_main) public class MainFragment extends Fragment { ! @Click(R.id.button_ok) void
ok() { … } ! ! ! ! ! ! } @LongClick(R.id.button_ok)
Fragment fragment = MainFragment_.builder().position(7).build(); @Efragment(R.layout.fragment_main) public class MainFragment extends Fragment
{ ! @FragmentArgs int position; }
@Receiver(actions = BluetoothLeService.ACTION_DATA_AVAILABLE) void onHeartRateChanged() { startHRVMeasure(); }
@EActivity @OptionsMenu(R.menu.menu_main) public class MainActivity extends Activity { ! !
! ! ! ! ! ! ! } @OptionsItem(R.id.menuitem_refresh) void refresh() { … }
@SharedPref public interface MyPrefs { @DefaultString("yes") String name(); } @EActivity
public class MyActivity extends Activity { @Pref MyPrefs_ myPrefs; String name = myPrefs.name().get(); }
@EActivity MainActivity Java's Annotation Processing Tool MainActivity_ extends MainActivity Compiler
Reference: ! AndriodAnnotations http://androidannotations.org/ ! android-apt https://bitbucket.org/hvisser/android-apt Thanks for your
listening