SlideShare a Scribd company logo
1 of 8
Download to read offline
How to test GPS
on Emulator
potatotips #20
Problems to solve
• Execute test code effectively
• Android public emulator does not support
GPS sensors
Genymotion
• Fast
• x86 archirecture, VirtualBox
• Simple
• Some behavior with Android Public Emulator
• Powerfull
• Contro some sensor from API
Configuring Gradle Builds
repositories {
maven{
url "http://api.genymotion.com/repositories/releases/"
}
}
dependencies {
androidTestCompile ‘com.genymotion.api:genymotion-api:1.0.2’
}
How to use (GPS Sensors)
GenymotionManager genymotion =
GenymotionManager.getGenymotionManager(ctx);
// Position to reykjavik (257km away))
Log.d(GpsSampleFragment.TAG, "Force position to Reykjavik");
genymotion.getGps()
.setLatitude(64.13367829)
.setLongitude(-21.8964386);
// Then ensure warning is hidden
Assert.assertEquals(tvWarning.getVisibility(), View.GONE);
// Position near Dalvik
Log.d(GpsSampleFragment.TAG, "Force position near Dalvik");
genymotion.getGps()
.setLatitude(65.9446)
.setLongitude(-18.35744619);
// Ensure warning is shown
Assert.assertEquals(tvWarning.getVisibility(), View.VISIBLE);
How to use (Battery Status)
GenymotionManager genymotion =
GenymotionManager.getGenymotionManager(getActivity());
// Change battery level and charging status
Log.d(BatterySampleFragment.TAG, "Force full battery + charging");
genymotion.getBattery()
.setLevel(100)
.setStatus(Battery.Status.CHARGING);
// Then ensure warning is hidden
Assert.assertEquals(tvWarning.getVisibility(), View.GONE);
// Change battery level and charging status
Log.d(BatterySampleFragment.TAG, "Force low battery");
genymotion.getBattery()
.setLevel(3)
.setStatus(Battery.Status.DISCHARGING);
// Then ensure warning is visible
Assert.assertEquals(tvWarning.getVisibility(), View.VISIBLE);
// set battery mode back to HOST
genymotion.getBattery().setMode(Battery.Mode.HOST);
Excursus
• Need to login
• Free
• For personal use only
• Business
• €24.99, per month,per user
• Java API
• need to emulate sensors
Thank you

More Related Content

Viewers also liked

watchOS1 to watchOS2
watchOS1 to watchOS2watchOS1 to watchOS2
watchOS1 to watchOS2Motoki Narita
 
Android Mのruntime-permissionに潜む罠
Android Mのruntime-permissionに潜む罠Android Mのruntime-permissionに潜む罠
Android Mのruntime-permissionに潜む罠ak_shio_555
 
とにかく明るいCore Spotlight
とにかく明るいCore Spotlightとにかく明るいCore Spotlight
とにかく明るいCore Spotlight今城 善矩
 
PUSH通知証明書作成ツールを作った
PUSH通知証明書作成ツールを作ったPUSH通知証明書作成ツールを作った
PUSH通知証明書作成ツールを作ったTomoki Hasegawa
 
Command Line Tool in swift
Command Line Tool in swiftCommand Line Tool in swift
Command Line Tool in swiftYusuke Kita
 
Leak canaryで メモリリーク調査
Leak canaryで メモリリーク調査Leak canaryで メモリリーク調査
Leak canaryで メモリリーク調査baroqueworksdev
 
実践アニメーション
実践アニメーション実践アニメーション
実践アニメーションNaoya Yunoue
 
Android lint-srp-practice
Android lint-srp-practiceAndroid lint-srp-practice
Android lint-srp-practicecch-robo
 
What is tested by pre-launch (security) reports?
What is tested by pre-launch (security) reports?What is tested by pre-launch (security) reports?
What is tested by pre-launch (security) reports?ak_shio_555
 
全てSになる -RxJavaとLWSを持ち込む楽しさ-
全てSになる -RxJavaとLWSを持ち込む楽しさ-全てSになる -RxJavaとLWSを持ち込む楽しさ-
全てSになる -RxJavaとLWSを持ち込む楽しさ-Ryutaro Miyashita
 
Androidアプリのストレージ戦略
Androidアプリのストレージ戦略Androidアプリのストレージ戦略
Androidアプリのストレージ戦略Masahiro Hidaka
 
minneにおけるテスト〜リリース〜リリース後にやっている事の紹介
minneにおけるテスト〜リリース〜リリース後にやっている事の紹介minneにおけるテスト〜リリース〜リリース後にやっている事の紹介
minneにおけるテスト〜リリース〜リリース後にやっている事の紹介Masataka Kono
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiYukiya Nakagawa
 

Viewers also liked (14)

just one line
just one linejust one line
just one line
 
watchOS1 to watchOS2
watchOS1 to watchOS2watchOS1 to watchOS2
watchOS1 to watchOS2
 
Android Mのruntime-permissionに潜む罠
Android Mのruntime-permissionに潜む罠Android Mのruntime-permissionに潜む罠
Android Mのruntime-permissionに潜む罠
 
とにかく明るいCore Spotlight
とにかく明るいCore Spotlightとにかく明るいCore Spotlight
とにかく明るいCore Spotlight
 
PUSH通知証明書作成ツールを作った
PUSH通知証明書作成ツールを作ったPUSH通知証明書作成ツールを作った
PUSH通知証明書作成ツールを作った
 
Command Line Tool in swift
Command Line Tool in swiftCommand Line Tool in swift
Command Line Tool in swift
 
Leak canaryで メモリリーク調査
Leak canaryで メモリリーク調査Leak canaryで メモリリーク調査
Leak canaryで メモリリーク調査
 
実践アニメーション
実践アニメーション実践アニメーション
実践アニメーション
 
Android lint-srp-practice
Android lint-srp-practiceAndroid lint-srp-practice
Android lint-srp-practice
 
What is tested by pre-launch (security) reports?
What is tested by pre-launch (security) reports?What is tested by pre-launch (security) reports?
What is tested by pre-launch (security) reports?
 
全てSになる -RxJavaとLWSを持ち込む楽しさ-
全てSになる -RxJavaとLWSを持ち込む楽しさ-全てSになる -RxJavaとLWSを持ち込む楽しさ-
全てSになる -RxJavaとLWSを持ち込む楽しさ-
 
Androidアプリのストレージ戦略
Androidアプリのストレージ戦略Androidアプリのストレージ戦略
Androidアプリのストレージ戦略
 
minneにおけるテスト〜リリース〜リリース後にやっている事の紹介
minneにおけるテスト〜リリース〜リリース後にやっている事の紹介minneにおけるテスト〜リリース〜リリース後にやっている事の紹介
minneにおけるテスト〜リリース〜リリース後にやっている事の紹介
 
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigiReact Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
React Nativeはクロスプラットフォームモバイルアプリ開発の夢を見るか #DroidKaigi
 

Similar to 20150811 potatotips 20

OpenCensus with Prometheus and Kubernetes
OpenCensus with Prometheus and KubernetesOpenCensus with Prometheus and Kubernetes
OpenCensus with Prometheus and KubernetesJinwoong Kim
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Chris Ramsdale
 
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinAbgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinDanny Preussler
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010Chris Ramsdale
 
Opencensus with prometheus and kubernetes
Opencensus with prometheus and kubernetesOpencensus with prometheus and kubernetes
Opencensus with prometheus and kubernetesJinwoong Kim
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGiRobert Munteanu
 
jQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapjQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapSwiip
 
Augmented Reality on iPhone Applications
Augmented Reality on iPhone ApplicationsAugmented Reality on iPhone Applications
Augmented Reality on iPhone ApplicationsOmar Cafini
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App EngineInphina Technologies
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App EngineIndicThreads
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitAriya Hidayat
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Roberto Franchini
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaChristopher Bartling
 
Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with JenkinsVishal Nayak
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 

Similar to 20150811 potatotips 20 (20)

OpenCensus with Prometheus and Kubernetes
OpenCensus with Prometheus and KubernetesOpenCensus with Prometheus and Kubernetes
OpenCensus with Prometheus and Kubernetes
 
Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
 
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, BerlinAbgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
Abgeschottete Realität - Testen im Emulator, Mobile Testing Days 2014, Berlin
 
JBoss World 2010
JBoss World 2010JBoss World 2010
JBoss World 2010
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010
 
Opencensus with prometheus and kubernetes
Opencensus with prometheus and kubernetesOpencensus with prometheus and kubernetes
Opencensus with prometheus and kubernetes
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Will it blend? Java agents and OSGi
Will it blend? Java agents and OSGiWill it blend? Java agents and OSGi
Will it blend? Java agents and OSGi
 
jQuery Mobile & PhoneGap
jQuery Mobile & PhoneGapjQuery Mobile & PhoneGap
jQuery Mobile & PhoneGap
 
Augmented reality
Augmented realityAugmented reality
Augmented reality
 
Augmented Reality on iPhone Applications
Augmented Reality on iPhone ApplicationsAugmented Reality on iPhone Applications
Augmented Reality on iPhone Applications
 
Testing your application on Google App Engine
Testing your application on Google App EngineTesting your application on Google App Engine
Testing your application on Google App Engine
 
Testing Your Application On Google App Engine
Testing Your Application On Google App EngineTesting Your Application On Google App Engine
Testing Your Application On Google App Engine
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
 
Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!Integration tests: use the containers, Luke!
Integration tests: use the containers, Luke!
 
JavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and KarmaJavaScript TDD with Jasmine and Karma
JavaScript TDD with Jasmine and Karma
 
Genymotion with Jenkins
Genymotion with JenkinsGenymotion with Jenkins
Genymotion with Jenkins
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 

More from tkawashita

DevRelMeetup Tokyo #36 技術書典5 参加報告
DevRelMeetup Tokyo #36 技術書典5 参加報告DevRelMeetup Tokyo #36 技術書典5 参加報告
DevRelMeetup Tokyo #36 技術書典5 参加報告tkawashita
 
DroidKaigi2016 windows環境での効率的なアプリ開発手法
DroidKaigi2016 windows環境での効率的なアプリ開発手法DroidKaigi2016 windows環境での効率的なアプリ開発手法
DroidKaigi2016 windows環境での効率的なアプリ開発手法tkawashita
 
20150916 potatotips 21_public
20150916 potatotips 21_public20150916 potatotips 21_public
20150916 potatotips 21_publictkawashita
 
201401217 potatotips no12-for_slideshare_english
201401217 potatotips no12-for_slideshare_english201401217 potatotips no12-for_slideshare_english
201401217 potatotips no12-for_slideshare_englishtkawashita
 
201401217 potatotips No12
201401217 potatotips No12201401217 potatotips No12
201401217 potatotips No12tkawashita
 
20140312 potatotips no5
20140312 potatotips no520140312 potatotips no5
20140312 potatotips no5tkawashita
 
20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...
20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...
20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...tkawashita
 
20110813 andeb10資料
20110813 andeb10資料20110813 andeb10資料
20110813 andeb10資料tkawashita
 
Iosched読書会向け資料
Iosched読書会向け資料Iosched読書会向け資料
Iosched読書会向け資料tkawashita
 

More from tkawashita (9)

DevRelMeetup Tokyo #36 技術書典5 参加報告
DevRelMeetup Tokyo #36 技術書典5 参加報告DevRelMeetup Tokyo #36 技術書典5 参加報告
DevRelMeetup Tokyo #36 技術書典5 参加報告
 
DroidKaigi2016 windows環境での効率的なアプリ開発手法
DroidKaigi2016 windows環境での効率的なアプリ開発手法DroidKaigi2016 windows環境での効率的なアプリ開発手法
DroidKaigi2016 windows環境での効率的なアプリ開発手法
 
20150916 potatotips 21_public
20150916 potatotips 21_public20150916 potatotips 21_public
20150916 potatotips 21_public
 
201401217 potatotips no12-for_slideshare_english
201401217 potatotips no12-for_slideshare_english201401217 potatotips no12-for_slideshare_english
201401217 potatotips no12-for_slideshare_english
 
201401217 potatotips No12
201401217 potatotips No12201401217 potatotips No12
201401217 potatotips No12
 
20140312 potatotips no5
20140312 potatotips no520140312 potatotips no5
20140312 potatotips no5
 
20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...
20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...
20140115 potato tips No.3 Android App Test Development Driven and Jenkins CI ...
 
20110813 andeb10資料
20110813 andeb10資料20110813 andeb10資料
20110813 andeb10資料
 
Iosched読書会向け資料
Iosched読書会向け資料Iosched読書会向け資料
Iosched読書会向け資料
 

Recently uploaded

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptesrabilgic2
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 

Recently uploaded (20)

A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).ppt
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 

20150811 potatotips 20

  • 1. How to test GPS on Emulator potatotips #20
  • 2. Problems to solve • Execute test code effectively • Android public emulator does not support GPS sensors
  • 3. Genymotion • Fast • x86 archirecture, VirtualBox • Simple • Some behavior with Android Public Emulator • Powerfull • Contro some sensor from API
  • 4. Configuring Gradle Builds repositories { maven{ url "http://api.genymotion.com/repositories/releases/" } } dependencies { androidTestCompile ‘com.genymotion.api:genymotion-api:1.0.2’ }
  • 5. How to use (GPS Sensors) GenymotionManager genymotion = GenymotionManager.getGenymotionManager(ctx); // Position to reykjavik (257km away)) Log.d(GpsSampleFragment.TAG, "Force position to Reykjavik"); genymotion.getGps() .setLatitude(64.13367829) .setLongitude(-21.8964386); // Then ensure warning is hidden Assert.assertEquals(tvWarning.getVisibility(), View.GONE); // Position near Dalvik Log.d(GpsSampleFragment.TAG, "Force position near Dalvik"); genymotion.getGps() .setLatitude(65.9446) .setLongitude(-18.35744619); // Ensure warning is shown Assert.assertEquals(tvWarning.getVisibility(), View.VISIBLE);
  • 6. How to use (Battery Status) GenymotionManager genymotion = GenymotionManager.getGenymotionManager(getActivity()); // Change battery level and charging status Log.d(BatterySampleFragment.TAG, "Force full battery + charging"); genymotion.getBattery() .setLevel(100) .setStatus(Battery.Status.CHARGING); // Then ensure warning is hidden Assert.assertEquals(tvWarning.getVisibility(), View.GONE); // Change battery level and charging status Log.d(BatterySampleFragment.TAG, "Force low battery"); genymotion.getBattery() .setLevel(3) .setStatus(Battery.Status.DISCHARGING); // Then ensure warning is visible Assert.assertEquals(tvWarning.getVisibility(), View.VISIBLE); // set battery mode back to HOST genymotion.getBattery().setMode(Battery.Mode.HOST);
  • 7. Excursus • Need to login • Free • For personal use only • Business • €24.99, per month,per user • Java API • need to emulate sensors