SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
The Best from Google IO
Ondra Zahradník
@ondraz
Monday, May 27, 13
Agenda
• Gradle
• Volley
• Mobile Backend Starter
• Location
• Activity Recognition
• Games
• Google Play Console etc.
Monday, May 27, 13
Gradle
• Dependency mgmt.
• Library support
• Reuse of code and resources
• Build variants
• Testing, CI, SCM automation
• Use Gradle 1.6 and android plugin 0.4!
• Android Studio integration
Monday, May 27, 13
Monday, May 27, 13
Gradle Build Script
//configuration for gradle build
buildscript {
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
//gradle android plugin
apply plugin: 'android'
//android DSL
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
}
Monday, May 27, 13
Gradle BuildType
• Defines how app is build
• Signing, proguard on/off, zipalign
• Package name suffix
signingConfigs {
inmite {
storeFile file("inmite.keystore")
keyAlias "inmite_android"
}
}
buildTypes {
debug {
packageNameSuffix ".debug"
versionNameSuffix "-debug"
}
release {
signingConfig signingConfigs.inmite
}
}
Monday, May 27, 13
Gradle - Variants
• Free vs. Paid
• Multi-apk support
• Different runtimes,...
• Flavors = productFlavors
• Multi-flavor variants = flavorGroups
Monday, May 27, 13
Gradle Project Structure
/src
/main
/java
/eu/inmite.gradle.example
/res
/drawables
/values
...
AndroidManifest.xml
/resources
/paid
/java
...
/src/instrumentTest
Monday, May 27, 13
Gradle Libraries
• binary .aar package in existing repos
• supports proguard
• custom lint rules come later
//dependence on an external jar library
//configurations - compile, instrumentTestCompile
// debugCompile, releaseCompile
dependencies {
compile files('libs/android-support-v4.jar')
compile 'com.google.guava:guava:14.0.1'
}
Monday, May 27, 13
Gradle Tasks
• assemble
• assembleDebug
• assembleRelease
• check
• deviceCheck
• build
• clean
Monday, May 27, 13
Volley
• Typical catches
• single-thread
• screen rotations = reloading
• not using recycled views
• Apache HTTP vs. URLConnection
Monday, May 27, 13
Volley
• Yet another networking library?
• 4 threads in background, prioritization
• mem/disk cache
• request cancellation
• !NetworkImageView!
• Network layers - OkHttp, URLConnection,
ApacheHttp, SPDY,...
Monday, May 27, 13
Volley - Request
mRequestQueue = ((Application) getApplication()).getRequestQueue();
mImageLoader = new ImageLoader(mRequestQueue, new BitmapLRUCache());
mRequestQueue.add(
new JsonObjectRequest(
"https://dl.dropboxusercontent.com/u/5296640/a.json",
null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonObject) {
try {
final JSONArray urls = (JSONArray) jsonObject.getJSONArray("images");
final String[] data = new String[urls.length()];
for (int i = 0; i < urls.length(); i++) {
data[i] = urls.getString(i);
}
mImageAdapter = new ImageAdapter(data);
setListAdapter(mImageAdapter);
} catch (JSONException e) {
Toast.makeText(..., getString(R.string.parse_error), ...).show();
}
}
},
null));
Monday, May 27, 13
Volley - NetworkImageView
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
...
final ViewHolder vh = (ViewHolder) view.getTag();
vh.iv.setImageUrl(data[i], mImageLoader);
return view;
}
private class ViewHolder {
NetworkImageView iv;
}
Monday, May 27, 13
Mobile Backend Starter
• No code backend
• Google auth built in
• Google Cloud Messaging
• Continuous queries
Monday, May 27, 13
Beyond the Blue Dot
• Contextual apps
• Fused location provider = sensors in play
• Listeners
mLocationClient = new LocationClient(this, this, this);
mLocationClient.connect();
Location location = mLocationClient.getLastLocation();
LocationRequest mLocationRequest = LocationRequest
.create()
.setInterval(5000)
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationClient.requestLocationUpdates(
mLocationRequest,
mLocationListener);
Monday, May 27, 13
Beyond the Blue Dot
• PendingIntent
mLocationClient = new LocationClient(this, this, this);
mLocationClient.connect();
LocationRequest mLocationRequest = LocationRequest
.create()
.setInterval(5000)
.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
PendingIntent pi = PendingIntent.getService(this, 0,
new Intent("com.example.location"), 0);
mLocationClient.requestLocationUpdates(mLocationRequest, pi);
Monday, May 27, 13
Geofencing
Monday, May 27, 13
Geofencing
PendingIntent pi = PendingIntent.getService(
this, 0, new Intent("com.example.location"), 0);
Geofence geofence = new Geofence.Builder()
.setRequestId("id")
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER)
.setCircularRegion(10,10,10)
.setExpirationDuration(1000).build();
final List<Geofence> gfcs = new ArrayList<Geofence>();
gfcs.add(geofence);
mLocationClient.addGeofences(gfcs, pi,
new LocationClient.OnAddGeofencesResultListener() {
@Override
public void onAddGeofencesResult(int i, String[] strings) {
if (i != LocationStatusCodes.SUCCESS) {
Toast.makeText(
MyActivity.this,
"Cannot add geofences",
Toast.LENGTH_SHORT).show();
}
}
});
Monday, May 27, 13
Activity Recognition
• Riding, walking, cycling, still, tilting
// Connect to the ActivityRecognitionService
ActivityRecognitionClient mActivityRecognitionClient =
new ActivityRecognitionClient(this, this, this);
mActivityRecognitionClient.connect();
// Called when a connection to the ActivityRecognitionService
//has been established.
public void onConnected(Bundle connectionHint) {
Intent intent = new Intent(this, MyIntentService.class);
PendingIntent callbackIntent =
PendingIntent.getService(
this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
mActivityRecognitionClient.requestActivityUpdates(
30000, callbackIntent);
}
Monday, May 27, 13
Game API
Monday, May 27, 13
Game API
• G+ SSO
Monday, May 27, 13
Game API
• G+ SSO
• Achievements
Monday, May 27, 13
Game API
• G+ SSO
• Achievements
• Leaderboards
Monday, May 27, 13
Game API
• G+ SSO
• Achievements
• Leaderboards
• Cloud Save
Monday, May 27, 13
Game API
• G+ SSO
• Achievements
• Leaderboards
• Cloud Save
• Multiplayer
Monday, May 27, 13
Game API
• G+ SSO
• Achievements
• Leaderboards
• Cloud Save
• Multiplayer
• Works on Android, iOS, Web (except multi)
Monday, May 27, 13
Game API
• G+ SSO
• Achievements
• Leaderboards
• Cloud Save
• Multiplayer
• Works on Android, iOS, Web (except multi)
• Quota 20mil req/day and 5req/sec/user
Monday, May 27, 13
Google Play Console
Monday, May 27, 13
Google Play Console
Monday, May 27, 13
Google Play Console
Monday, May 27, 13
Google Play Console
Monday, May 27, 13
Etc.
• In-app Purchase
• Simpler API for Google Cloud Messaging
• Cloud Connection Server = XMPP
• Synchronized notifications
• Google Play for Education
Monday, May 27, 13
Thank You!
@ondraz
Monday, May 27, 13

Mais conteúdo relacionado

Mais procurados

Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
DrupalCampDN
 
Nuxeo - OpenSocial
Nuxeo - OpenSocialNuxeo - OpenSocial
Nuxeo - OpenSocial
Thomas Roger
 

Mais procurados (20)

Big query - Command line tools and Tips - (MOSG)
Big query - Command line tools and Tips - (MOSG)Big query - Command line tools and Tips - (MOSG)
Big query - Command line tools and Tips - (MOSG)
 
Praktik Pengembangan Konten E-Learning HTML5 Sederhana
Praktik Pengembangan Konten E-Learning HTML5 SederhanaPraktik Pengembangan Konten E-Learning HTML5 Sederhana
Praktik Pengembangan Konten E-Learning HTML5 Sederhana
 
【Unity】Scriptable object 入門と活用例
【Unity】Scriptable object 入門と活用例【Unity】Scriptable object 入門と活用例
【Unity】Scriptable object 入門と活用例
 
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
[Srijan Wednesday Webinars] Ruling Drupal 8 with #d8rules
 
D Baker - Galaxy Update
D Baker - Galaxy UpdateD Baker - Galaxy Update
D Baker - Galaxy Update
 
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
[Srijan Wednesday Webinar] Rails 5: What's in It for Me?
 
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech TalkHacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech Talk
 
Introdução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com KotlinIntrodução ao Desenvolvimento Android com Kotlin
Introdução ao Desenvolvimento Android com Kotlin
 
WaveEngine 2D components
WaveEngine 2D componentsWaveEngine 2D components
WaveEngine 2D components
 
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoTJSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
JSDC 2017 - 使用google cloud 從雲到端,動手刻個IoT
 
Rest application
Rest applicationRest application
Rest application
 
WaveEngine 3D components
WaveEngine 3D componentsWaveEngine 3D components
WaveEngine 3D components
 
Aplicações assíncronas no Android com
Coroutines & Jetpack
Aplicações assíncronas no Android com
Coroutines & JetpackAplicações assíncronas no Android com
Coroutines & Jetpack
Aplicações assíncronas no Android com
Coroutines & Jetpack
 
Taller evento TestingUY 2017 - API Testing utilizando Chakram
Taller evento TestingUY 2017 - API Testing utilizando ChakramTaller evento TestingUY 2017 - API Testing utilizando Chakram
Taller evento TestingUY 2017 - API Testing utilizando Chakram
 
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
 
Add Some Fun to Your Functional Programming With RXJS
Add Some Fun to Your Functional Programming With RXJSAdd Some Fun to Your Functional Programming With RXJS
Add Some Fun to Your Functional Programming With RXJS
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
Building scalable applications with hazelcast
Building scalable applications with hazelcastBuilding scalable applications with hazelcast
Building scalable applications with hazelcast
 
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
COSCUP 2020 Google 技術 x 公共參與 x 開源 口罩地圖技術開源
 
Nuxeo - OpenSocial
Nuxeo - OpenSocialNuxeo - OpenSocial
Nuxeo - OpenSocial
 

Destaque

Muni android-18-5-2012
Muni android-18-5-2012Muni android-18-5-2012
Muni android-18-5-2012
ondraz
 

Destaque (20)

MFF Android 2 5.12.2012
MFF Android 2 5.12.2012MFF Android 2 5.12.2012
MFF Android 2 5.12.2012
 
Muni android-18-5-2012
Muni android-18-5-2012Muni android-18-5-2012
Muni android-18-5-2012
 
GameZBoost White Label Gaming Platforms
GameZBoost White Label Gaming PlatformsGameZBoost White Label Gaming Platforms
GameZBoost White Label Gaming Platforms
 
Native Storytelling: Socially Connecting Brands
Native Storytelling: Socially Connecting BrandsNative Storytelling: Socially Connecting Brands
Native Storytelling: Socially Connecting Brands
 
(Almost) Everything You Need to Know about Social Strategy
(Almost) Everything You Need to Know about Social Strategy(Almost) Everything You Need to Know about Social Strategy
(Almost) Everything You Need to Know about Social Strategy
 
Social media strategy
Social media strategySocial media strategy
Social media strategy
 
How to integrate content strategy and social media
How to integrate content strategy and social mediaHow to integrate content strategy and social media
How to integrate content strategy and social media
 
GameZBoost White Label Gaming Platform Product Deck
GameZBoost White Label Gaming Platform Product DeckGameZBoost White Label Gaming Platform Product Deck
GameZBoost White Label Gaming Platform Product Deck
 
Enterprise File Share and Sync with CleverSafe
Enterprise File Share and Sync with CleverSafeEnterprise File Share and Sync with CleverSafe
Enterprise File Share and Sync with CleverSafe
 
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
Leveraging New Features in CA Single-Sign on to Enable Web Services, Social S...
 
Mobile SSO: are we there yet?
Mobile SSO: are we there yet?Mobile SSO: are we there yet?
Mobile SSO: are we there yet?
 
GameZBoost White Label Gaming Platform Overview
GameZBoost White Label Gaming Platform OverviewGameZBoost White Label Gaming Platform Overview
GameZBoost White Label Gaming Platform Overview
 
Sso every where
Sso every whereSso every where
Sso every where
 
What is your Enterprise App Store Strategy?
What is your Enterprise App Store Strategy?What is your Enterprise App Store Strategy?
What is your Enterprise App Store Strategy?
 
Social Strategy: Why Does Strategy Get Left Behind?
Social Strategy: Why Does Strategy Get Left Behind?Social Strategy: Why Does Strategy Get Left Behind?
Social Strategy: Why Does Strategy Get Left Behind?
 
mDevCamp - Android a práce na pozadí
mDevCamp - Android a práce na pozadímDevCamp - Android a práce na pozadí
mDevCamp - Android a práce na pozadí
 
Login social con node.js
Login social con node.jsLogin social con node.js
Login social con node.js
 
Kick Your Social Strategy Into Overdrive: The Ins & Outs of Testing Social
Kick Your Social Strategy Into Overdrive: The Ins & Outs of Testing SocialKick Your Social Strategy Into Overdrive: The Ins & Outs of Testing Social
Kick Your Social Strategy Into Overdrive: The Ins & Outs of Testing Social
 
Building an SSO platform in PHP (Zend Webinar Edition)
Building an SSO platform in PHP (Zend Webinar Edition)Building an SSO platform in PHP (Zend Webinar Edition)
Building an SSO platform in PHP (Zend Webinar Edition)
 
Tuscany Social Strategy for tourism. London keynote
Tuscany Social Strategy for tourism. London keynoteTuscany Social Strategy for tourism. London keynote
Tuscany Social Strategy for tourism. London keynote
 

Semelhante a mDevCamp - The Best from Google IO

Automated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.xAutomated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.x
Tatsuya Maki
 
Open analytics | Cameron Sim
Open analytics | Cameron SimOpen analytics | Cameron Sim
Open analytics | Cameron Sim
Open Analytics
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
偉格 高
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
Igor Bronovskyy
 

Semelhante a mDevCamp - The Best from Google IO (20)

Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
 
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud PlatformBackend, app e internet das coisas com NodeJS no Google Cloud Platform
Backend, app e internet das coisas com NodeJS no Google Cloud Platform
 
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
Reactive Java Microservices with Spring Boot and JHipster - Denver JUG 2021
 
soft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.jssoft-shake.ch - Hands on Node.js
soft-shake.ch - Hands on Node.js
 
第一次用Parse就深入淺出
第一次用Parse就深入淺出第一次用Parse就深入淺出
第一次用Parse就深入淺出
 
Automated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.xAutomated%20testing%20with%20Espresso2.x
Automated%20testing%20with%20Espresso2.x
 
Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long
 
Javascript first-class citizenery
Javascript first-class citizeneryJavascript first-class citizenery
Javascript first-class citizenery
 
Droidcon Paris 2015
Droidcon Paris 2015Droidcon Paris 2015
Droidcon Paris 2015
 
Atlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring IntegrationAtlanta JUG - Integrating Spring Batch and Spring Integration
Atlanta JUG - Integrating Spring Batch and Spring Integration
 
Advanced android app development
Advanced android app developmentAdvanced android app development
Advanced android app development
 
Open analytics | Cameron Sim
Open analytics | Cameron SimOpen analytics | Cameron Sim
Open analytics | Cameron Sim
 
Module, AMD, RequireJS
Module, AMD, RequireJSModule, AMD, RequireJS
Module, AMD, RequireJS
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Quick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase ServerQuick and Easy Development with Node.js and Couchbase Server
Quick and Easy Development with Node.js and Couchbase Server
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analystsMeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
 
Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
 
3 Mobile App Dev Problems - Monospace
3 Mobile App Dev Problems - Monospace3 Mobile App Dev Problems - Monospace
3 Mobile App Dev Problems - Monospace
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

mDevCamp - The Best from Google IO

  • 1. The Best from Google IO Ondra Zahradník @ondraz Monday, May 27, 13
  • 2. Agenda • Gradle • Volley • Mobile Backend Starter • Location • Activity Recognition • Games • Google Play Console etc. Monday, May 27, 13
  • 3. Gradle • Dependency mgmt. • Library support • Reuse of code and resources • Build variants • Testing, CI, SCM automation • Use Gradle 1.6 and android plugin 0.4! • Android Studio integration Monday, May 27, 13
  • 5. Gradle Build Script //configuration for gradle build buildscript { repositories { maven { url 'http://repo1.maven.org/maven2' } } dependencies { classpath 'com.android.tools.build:gradle:0.4' } } //gradle android plugin apply plugin: 'android' //android DSL android { compileSdkVersion 17 buildToolsVersion "17.0.0" } Monday, May 27, 13
  • 6. Gradle BuildType • Defines how app is build • Signing, proguard on/off, zipalign • Package name suffix signingConfigs { inmite { storeFile file("inmite.keystore") keyAlias "inmite_android" } } buildTypes { debug { packageNameSuffix ".debug" versionNameSuffix "-debug" } release { signingConfig signingConfigs.inmite } } Monday, May 27, 13
  • 7. Gradle - Variants • Free vs. Paid • Multi-apk support • Different runtimes,... • Flavors = productFlavors • Multi-flavor variants = flavorGroups Monday, May 27, 13
  • 9. Gradle Libraries • binary .aar package in existing repos • supports proguard • custom lint rules come later //dependence on an external jar library //configurations - compile, instrumentTestCompile // debugCompile, releaseCompile dependencies { compile files('libs/android-support-v4.jar') compile 'com.google.guava:guava:14.0.1' } Monday, May 27, 13
  • 10. Gradle Tasks • assemble • assembleDebug • assembleRelease • check • deviceCheck • build • clean Monday, May 27, 13
  • 11. Volley • Typical catches • single-thread • screen rotations = reloading • not using recycled views • Apache HTTP vs. URLConnection Monday, May 27, 13
  • 12. Volley • Yet another networking library? • 4 threads in background, prioritization • mem/disk cache • request cancellation • !NetworkImageView! • Network layers - OkHttp, URLConnection, ApacheHttp, SPDY,... Monday, May 27, 13
  • 13. Volley - Request mRequestQueue = ((Application) getApplication()).getRequestQueue(); mImageLoader = new ImageLoader(mRequestQueue, new BitmapLRUCache()); mRequestQueue.add( new JsonObjectRequest( "https://dl.dropboxusercontent.com/u/5296640/a.json", null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject jsonObject) { try { final JSONArray urls = (JSONArray) jsonObject.getJSONArray("images"); final String[] data = new String[urls.length()]; for (int i = 0; i < urls.length(); i++) { data[i] = urls.getString(i); } mImageAdapter = new ImageAdapter(data); setListAdapter(mImageAdapter); } catch (JSONException e) { Toast.makeText(..., getString(R.string.parse_error), ...).show(); } } }, null)); Monday, May 27, 13
  • 14. Volley - NetworkImageView @Override public View getView(int i, View view, ViewGroup viewGroup) { ... final ViewHolder vh = (ViewHolder) view.getTag(); vh.iv.setImageUrl(data[i], mImageLoader); return view; } private class ViewHolder { NetworkImageView iv; } Monday, May 27, 13
  • 15. Mobile Backend Starter • No code backend • Google auth built in • Google Cloud Messaging • Continuous queries Monday, May 27, 13
  • 16. Beyond the Blue Dot • Contextual apps • Fused location provider = sensors in play • Listeners mLocationClient = new LocationClient(this, this, this); mLocationClient.connect(); Location location = mLocationClient.getLastLocation(); LocationRequest mLocationRequest = LocationRequest .create() .setInterval(5000) .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationClient.requestLocationUpdates( mLocationRequest, mLocationListener); Monday, May 27, 13
  • 17. Beyond the Blue Dot • PendingIntent mLocationClient = new LocationClient(this, this, this); mLocationClient.connect(); LocationRequest mLocationRequest = LocationRequest .create() .setInterval(5000) .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); PendingIntent pi = PendingIntent.getService(this, 0, new Intent("com.example.location"), 0); mLocationClient.requestLocationUpdates(mLocationRequest, pi); Monday, May 27, 13
  • 19. Geofencing PendingIntent pi = PendingIntent.getService( this, 0, new Intent("com.example.location"), 0); Geofence geofence = new Geofence.Builder() .setRequestId("id") .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER) .setCircularRegion(10,10,10) .setExpirationDuration(1000).build(); final List<Geofence> gfcs = new ArrayList<Geofence>(); gfcs.add(geofence); mLocationClient.addGeofences(gfcs, pi, new LocationClient.OnAddGeofencesResultListener() { @Override public void onAddGeofencesResult(int i, String[] strings) { if (i != LocationStatusCodes.SUCCESS) { Toast.makeText( MyActivity.this, "Cannot add geofences", Toast.LENGTH_SHORT).show(); } } }); Monday, May 27, 13
  • 20. Activity Recognition • Riding, walking, cycling, still, tilting // Connect to the ActivityRecognitionService ActivityRecognitionClient mActivityRecognitionClient = new ActivityRecognitionClient(this, this, this); mActivityRecognitionClient.connect(); // Called when a connection to the ActivityRecognitionService //has been established. public void onConnected(Bundle connectionHint) { Intent intent = new Intent(this, MyIntentService.class); PendingIntent callbackIntent = PendingIntent.getService( this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); mActivityRecognitionClient.requestActivityUpdates( 30000, callbackIntent); } Monday, May 27, 13
  • 22. Game API • G+ SSO Monday, May 27, 13
  • 23. Game API • G+ SSO • Achievements Monday, May 27, 13
  • 24. Game API • G+ SSO • Achievements • Leaderboards Monday, May 27, 13
  • 25. Game API • G+ SSO • Achievements • Leaderboards • Cloud Save Monday, May 27, 13
  • 26. Game API • G+ SSO • Achievements • Leaderboards • Cloud Save • Multiplayer Monday, May 27, 13
  • 27. Game API • G+ SSO • Achievements • Leaderboards • Cloud Save • Multiplayer • Works on Android, iOS, Web (except multi) Monday, May 27, 13
  • 28. Game API • G+ SSO • Achievements • Leaderboards • Cloud Save • Multiplayer • Works on Android, iOS, Web (except multi) • Quota 20mil req/day and 5req/sec/user Monday, May 27, 13
  • 33. Etc. • In-app Purchase • Simpler API for Google Cloud Messaging • Cloud Connection Server = XMPP • Synchronized notifications • Google Play for Education Monday, May 27, 13