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 Intents using Dart & Henson
Search
Diego Velásquez
August 20, 2017
Programming
100
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android Intents using Dart & Henson
Diego Velásquez
August 20, 2017
More Decks by Diego Velásquez
See All by Diego Velásquez
Flutter: Don't be afraid, State Management is your friend
diegoveloper
2
85
Stateful & Async Widgets
diegoveloper
0
120
Bienvenido a Flutter
diegoveloper
0
70
Beautiful apps in record time with Flutter
diegoveloper
0
60
Hello Flutter - Beautiful apps in record time
diegoveloper
0
150
Introducción a Flutter
diegoveloper
1
210
Flutter y el impacto en el mercado actual de apps móviles
diegoveloper
0
160
Let's start with Flutter
diegoveloper
0
88
Hello Flutter!
diegoveloper
0
170
Other Decks in Programming
See All in Programming
LLM 101: Exploring LLMs, Starting with Tokens.
dalinaum
0
100
Modernizing iOS Apps
seyfoyun
0
150
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
110
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
370
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9k
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
340
GraphQL の onError と Nullability のこれから
quramy
0
210
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
330
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
310
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
300
ActionController meets Protocol Buffers
sorah
1
800
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
560
Featured
See All Featured
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Product Roadmaps are Hard
iamctodd
55
13k
The Cult of Friendly URLs
andyhume
79
7.1k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
400
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
48k
Done Done
chrislema
187
17k
Transcript
Android Intents with Dart & Henson Diego Velasquez Android Developer
Belatrix SF @diegoveloper
Intents An intent is an abstract description of an operation
to be performed. Activity Broadcast Receiver Service Intent
Have not specified a component; instead declare a general action
to perform, which allows a component from another app to handle it Intent types Have specified a component which provides the exact class to be run. Implicit Explicit
Intent intent = new Intent( this, DetailActivity.class); startActivity(intent); Explicit Intent
MainActivity.class DetailActivity.class
Creating & Consuming Intents public static final String INTENT_PARAM =
"param_name"; ... Intent intent = new Intent( this, DetailActivity.class); intent.putExtra(INTENT_PARAM, "Android"); startActivity(intent); public static final String INTENT_PARAM = "param_name"; ... Intent intent = getIntent(); if (intent != null && intent.hasExtra(INTENT_PARAM)){ String name = getIntent().getStringExtra(INTENT_PARAM); }
What do we do? public static void startDetailActivity(Context context, String
param1, String param2){ Intent intent = new Intent(context, DetailActivity.class); intent.putExtra("PARAM_1", param1); intent.putExtra("PARAM_2",param2); context.startActivity(intent); } public static void startDetailActivity(Context context, String param1){ Intent intent = new Intent(context, DetailActivity.class); intent.putExtra("PARAM_1", param1); context.startActivity(intent); } public static void startDetailActivity(Context context, String param1, String param2){ Intent intent = new Intent(context, DetailActivity.class); if (param1 != null) intent.putExtra("PARAM_1", param1); if (param2 != null) intent.putExtra("PARAM_2",param2); context.startActivity(intent); } public static void startDetailActivity(Context context, String param1){ startDetailActivity(context, param1,null); } Refactoring
Dart & Henson Android dependency Injection library to deal with
Intent data passing
Dart: Consuming Intents DetailActivity.java @InjectExtra String paramName; … @Override protected
void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_detail); Dart.inject(this); }
Dart: Features @InjectExtra String paramName; @InjectExtra User user; @InjectExtra("quantity") int
quantityValue; @InjectExtra boolean isSuccess = false; @Nullable @InjectExtra String anotherValue; public class DetailModel { @InjectExtra String valueModel; public String getValueModel() { return valueModel; } } DetailActivity.java DetailModel model = new DetailModel(); …. @Override protected void onCreate(Bundle savedInstanceState) { …. Dart.inject(model,this); String ourValue = model.getValueModel(); }
Dart: Set Up build.gradle compile 'com.f2prateek.dart:dart:2.0.2' provided 'com.f2prateek.dart:dart-processor:2.0.2'
Henson: Creating Intents @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); Intent intent = Henson.with(this).gotoDetailActivity().paramName("Test value").build(); startActivity(intent); }
Henson: Features Intent intent = Henson.with(this).gotoDetailActivity() .isSuccess(true) .paramName("Test") .quantity(5) .user(new
User()) .build(); startActivity(intent); @HensonNavigable(model = DetailModel.class) public class DetailActivity extends AppCompatActivity { DetailModel model = new DetailModel(); …. @Override protected void onCreate(Bundle savedInstanceState) { …. Dart.inject(model,this); } Intent intent = Henson.with(this).goToDetailActivity().valueModel("testing").build(); startActivity(intent);
Henson: Set Up build.gradle compile 'com.f2prateek.dart:henson:2.0.2' provided 'com.f2prateek.dart:henson-processor:2.0.2'
Place your screenshot here Let’s code
References ▪ Intents: https://developer.android.com/guide/components/intents-filters.html ▪ Dart & Henson: https://github.com/f2prateek/dart
Thanks! Any questions? You can find me at ▪ https://github.com/diegoveloper
▪
[email protected]