Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Android Bootstrap
Search
Faru
September 06, 2016
Technology
92
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android Bootstrap
Best practices to start a new project
Faru
September 06, 2016
Other Decks in Technology
See All in Technology
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
220
Metadata - Section 1: HTML Basics
mohab1
0
120
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
230
Rust で関数型ドメインモデリング
takonda
0
140
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
860
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
920
オントロジーって 結局なにもの? AI エージェントに「意味」を渡す知識設計の話
greenmidori
0
200
しろおびから始める!ログ活用の第一歩
shumei_ito
0
950
USB PDを使ってスマホを労わりたい
raspython3
0
180
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
460
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
120
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
730
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
We Have a Design System, Now What?
morganepeng
55
8.4k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
540
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
360
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
The untapped power of vector embeddings
frankvandijk
2
1.9k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
The World Runs on Bad Software
bkeepers
PRO
72
12k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
The Curious Case for Waylosing
cassininazir
1
570
Transcript
Android Bootstrap Melhores práticas para iniciar um projeto sustentável Roberto
Junior github.com/robertojunior @vaifaru linkedin.com/in/roberto-junior
• Migrando de backend para mobile • Encarando um monstro
• E o Designer? • Escolhendo bem suas bibliotecas • Escolhendo padrão de projeto Agenda
• Bagagem profissional • Mudança de conceito • Desempenho •
E o Front-End? Migrando para Mobile
Encarando um monstro
• Regra de negócio na Activity • Dependências desatualizadas •
Bibliotecas pesadas e geração de código • Interface copiada do iOS O Monstro
E o Designer?
Material Design Sendo mais independente na parte visual https://material.google.com/
• Documentação https://material.google.com/ • Componentes https://github.com/wasabeef/awesome-android-ui • Icones https://design.google.com/icons/ https://materialdesignicons.com/
• Paleta de cores https://www.materialpalette.com/
Google não é Deus!?
Android != iOS
None
None
None
Escolhendo bibliotecas
ButterKnife Se preocupe com o que realmente importa http://jakewharton.github.io/butterknife/
Porque usar ButterKnife? • Elimine o findViewById usando @BindView nos
campos • Elimine classes anônimas internas para os Listeners anotando métodos com @OnClick e outros. • Elimine resources lookups usando as resource annotations nos campos
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
} } Usando o ButterKnife Project-level build.gradle Module-level build.gradle apply plugin: 'android-apt' android { ... } dependencies { compile 'com.jakewharton:butterknife:8.4.0' apt 'com.jakewharton:butterknife-compiler:8.4.0' }
public class MainActivity extends AppCompatActivity { TextView name; Button button;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView name = (TextView) findViewById(R.id.name); Button button = (Button) findViewById(R.id.button); } } Bind de views sem ButterKnife
public class MainActivity extends AppCompatActivity { @BindView(R.id.name) TextView name; @BindView(R.id.button)
Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); } } Bind de views com ButterKnife
public class MainActivity extends AppCompatActivity { TextView name; Button button;
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); TextView name = (TextView) findViewById(R.id.name); Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // ... } }); } } OnClickListener sem ButterKnife
public class MainActivity extends AppCompatActivity { @BindView(R.id.name) TextView name; @BindView(R.id.button)
Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @OnClick(R.id.button) public void onClickButton() { // ... } } OnClickListener com ButterKnife
Retrofit Integrando sua aplicação com o backend através de serviços
REST http://square.github.io/retrofit/
Usando o Retrofit Module-level build.gradle dependencies { compile ‘com.squareup.retrofit2:retrofit:2.1.0' }
Permissão AndroidManifest.xml <uses-permission android:name="android.permission.INTERNET" />
public interface BeerService { @GET("beers") Call<List<Beer>> getBeers(); @GET("beers/{beerId}") Call<Beer> getBeer(@Path("beerId")
Long beerId); @GET("beers/random") Call<Beer> getRandomBeer(); } Transformando sua HTTP API em uma Interface
Retrofit retrofit = new Retrofit.Builder() .baseUrl("https://api.brewerydb.com/v2/") .addConverterFactory(GsonConverterFactory.create()) .build(); BeerService service
= retrofit.create(BeerService.class); Call<List<Beer>> callBeers = service.getBeers(); callBeers.enqueue(new Callback<List<Beer>>() { @Override public void onResponse(Call<List<Beer>> call, Response<List<Beer>> response) { if (response.isSuccessful()) { // ... } } @Override public void onFailure(Call<List<Beer>> call, Throwable t) { // ... } }); Retrofit cria uma implementação de BeerService
OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); httpClient.addInterceptor(new Interceptor() { @Override public
okhttp3.Response intercept(Chain chain) throws IOException { final Request original = chain.request(); final Request.Builder requestBuilder = original.newBuilder() .url(original.url() + “&key=YOUR_KEY”) .method(original.method(), original.body()); final Request request = requestBuilder.build(); return chain.proceed(request); } }); retrofit = new Retrofit.Builder() .baseUrl("http://api.brewerydb.com/v2/") .addConverterFactory(GsonConverterFactory.create()) .client(httpClient.build()) .build(); Interceptor
Dagger Um pouco de DI e IOC https://github.com/google/dagger
Fresco Deixa pra quem sabe frescolib.org
Padrões de projeto
• MVC? • MVP • Clean Architecture • Nem tudo
é perfeito!
Obrigado! =) Roberto Junior github.com/robertojunior @vaifaru linkedin.com/in/roberto-junior