SlideShare a Scribd company logo
1 of 40
Download to read offline
Peter van der Linden
Android Technology
Evangelist
Jan 2014, Chicago

NASDAQ: IMMR

Putting Real Feeling
Into Android apps!
©2012 Immersion Corporation–Confidential
■ Agenda
1

Haptics

2

Creating a new project

3

Linking to a 3rd party Library

4

Running your code on a phone

5

Wrap up

©2012 Immersion Corporation–Confidential
1

Haptics

2

Creating a new project

3

Linking to a 3rd party Library

4

Running your code on a phone

5

Wrap up

©2012 Immersion Corporation–Confidential
The Mobile User

©2012 Immersion Corporation–Confidential

4
Solo!

©2012 Immersion Corporation–Confidential

© 2011 Immersion Corporatio
Agency TBWANeboko
Photo: Michael Harvey

Touch feedback
fills the human need for tactile gratification

CBS News
Photo: Walter Geis

©2012 Immersion Corporation–Confidential

© 2011 Immersion Corporatio
1

Haptics

2

Creating a new project

3

Linking to a 3rd party Library

4

Running your code on a phone

5

Wrap up

©2012 Immersion Corporation–Confidential
Android API levels
http://goo.gl/LuNCDG

©2012 Immersion Corporation–Confidential
Choosing Android API levels
It’s a tradeoff
•  You want the oldest possible API because – more
phones will run your app
•  You want the newest possible API because – better
quality, better performance, widest range of new features
Review market share of different API levels
http://goo.gl/219Br4
API level 14 is a good choice at present, but will fade out.

©2012 Immersion Corporation–Confidential
Create new project - Exercise
To create a new Android project in Eclipse
1. start Eclipse
2. select File > New > Project.
3. expand “Android”, then click > Android Application Project,
and click Next.
4. enter Application Name: Hello.
5. Enter Project Name: Helloworld
7. Package name: com.example.helloworld.
6. Select Min Reqd SDK: “API 14 Android 4.0”
7. Select Target SDK: “API 14”
9. Compile with: ”API 19” or any >= 14 where you have downloaded
that platform Then hit ”Next”
10. on “New Android App” uncheck “custom launcher icon”, click “Next”
11. on “Create Activity”, click “Next”.
12. Click Finish.

©2012 Immersion Corporation–Confidential
Create new project step 2 - 3
2. select File > New > Project…
3. expand “Android”, click > Android Application Project, click Next.

Running your Studio Project

©2012 Immersion Corporation–Confidential
Create a new Android project
■  File > New > Android Project

using Eclipse + ADT

Field

Purpose

Project name

What Eclipse calls this app Hello

Target

API level this app uses

14

App name

what phone calls the app

Hello

Package name

what Java calls the app

com.example.hello

Activity name

The file containing main

MainActivity

Min SDK version API level this app uses

Value to use

14

You must have installed the platform file for “target” and “minsdk” level that you choose. This is part of installing the
Eclipse bundle. Platforms live in the SDK & have names
like “platform-14”
©2012 Immersion Corporation–Confidential
Create new project step 4 - 9
4. enter Application Name: Hello.
5. Enter Project Name: Helloworld
7. Package name: com.example.helloworld.
6. Select Min Reqd SDK: “API 14 Android 4.0”
7. Select Target SDK: “API 14”
9. Compile with: ”API 14” or any >= 14 where you have
downloaded that platform Then hit ”Next”

Running your Studio Project

©2012 Immersion Corporation–Confidential
Create new project step 10
10. on “New Android App,” uncheck “custom launcher icon”,
click “Next”

Running your Studio Project

©2012 Immersion Corporation–Confidential
Create new project step 11
11. on “Create Activity”, click “Next”.
12. Click Finish.

Running your Studio Project

©2012 Immersion Corporation–Confidential
Create new project step 12
12. Note the “Activity name” and “layout name” you were given.
Click Finish.

©2012 Immersion Corporation–Confidential
New project appears in Eclipse

You can expand folders by clicking right pointing triangle
If project has errors, click Project > Clean > OK
©2012 Immersion Corporation–Confidential
1

Haptics

2

Creating a new project

3

Linking to a 3rd party Library

4

Running your code on a phone

5

Wrap up

©2012 Immersion Corporation–Confidential
Downloading the Immersion Haptic Platform
Immersion Haptic SDK Tools:
www.immersion.com/haptic/sdk
§  Download the Haptic SDK (450KB)
§  Download the Haptic Studio
(only for advanced custom effect design)

Haptic Effects Quick Start Guide:
www.immersion.com/haptic/guide

Immersion Haptic Effect Preview App
§  Download FREE from Google Play

©2012 Immersion Corporation–Confidential

19
Add Haptics to “Hello World!” Project
•  Download UHL zip file
•  Copy extracted libImmEmulatorJ.so file to libs/armeabi
folder (create folders if necessary)
•  Copy extracted UHL.jar to libs folder

©2012 Immersion Corporation–Confidential

2
0
Add a Button
in res/layout/activity_main.xml
<Button TextView!
android:text=”play effect!”!
android:onClick="handleClick"!
/>!
in src/… MainActivity.java
import android.view.View;!
!
public void handleClick(View v) { }!

©2012 Immersion Corporation–Confidential

21
©2012 Immersion Corporation–Confidential

22
Add Vibrate permission
in top level AndroidManifest.xml
<manifest

xmlns:android= …

/>!

!
<uses-permission!
! android:name="android.permission.VIBRATE" />!
!
<application android:icon= !
<activity>!
</activity>!
</application>!
!
</manifest>!

©2012 Immersion Corporation–Confidential

23
Add Import Statement
Import the UHL classes into your Activity

in src/… MainActivity.java
import com.immersion.uhl.*;!

©2012 Immersion Corporation–Confidential

24
Instantiate Launcher object
in src/… MainActivity.java
public class MainActivity extends Activity {!
!
Launcher haptic;!
!
@Override!
public void onCreate(Bundle b) {!
super.onCreate(b);!
haptic = new Launcher(this);!

©2012 Immersion Corporation–Confidential

25
Use the Haptic
Effect Preview App

©2012 Immersion Corporation–Confidential

26
Play Effect
public	
  sta+c	
  final	
  int	
  BOUNCE_100	
  =	
  0;	
  
	
  
	
  …	
  
public	
  sta+c	
  final	
  int	
  EXPLOSION7=	
  	
  79;	
  
public	
  sta+c	
  final	
  int	
  ENGINE4_33	
  =	
  123;

haptic.play(Launcher.EXPLOSION7);!

©2012 Immersion Corporation–Confidential

27
Stop any rendering when app Pauses
in src/… MainActivity.java
@Override!
!protected void onPause() {!
! !super.onPause();!
! !haptic.stop();!
!}!

©2012 Immersion Corporation–Confidential

28
Harden the code

try {!
!
haptic.play(Launcher.EXPLOSION7);!
!
} catch (RuntimeException e) {!
Log.e(”MyTestApp", e.getMessage());!
}!
©2012 Immersion Corporation–Confidential

29
In a nutshell, that’s it!
That’s all you need to put haptics in your app
Now you can add cool pre-made haptic effects to your
game applications.

©2012 Immersion Corporation–Confidential

30
Immersion Haptic SDK Plugins
§  Unity3D plugin

§  Marmalade plugin

§  YoYo Games

Plugins available at www.immersion.com/haptic/sdk

©2012 Immersion Corporation–Confidential

31
1

Haptics

2

Creating a new project

3

Linking to a 3rd party Library

4

Running your code on a phone

5

Wrap up

©2012 Immersion Corporation–Confidential
One time set up – using phone/tablet
Eclipse
ADT
Eclipse
plugin

SDK

Run As > Android Application

workspace
your
app
code

platform
library

©2012 Immersion Corporation–Confidential

actual
device
One time set up – PHONE / TABLET
Home > All Apps > Settings
•  Applications > Development
•  Click “USB Debugging” & “Stay awake”
•  Different in Ice Cream Sandwich (Dev options)
•  Different in Jelly Bean (Hidden! click “build num” 7x)

actual
device

Pull down Notification Shade > USB Connection
•  Click “Charge only”, “OK”
Connect the device to your devt PC with a micro USB cable
If using Windows, you need to install a driver on Windows. Get
it from phone manufacturer’s developer website.
©2012 Immersion Corporation–Confidential
Run app on phone / tablet

©2012 Immersion Corporation–Confidential
1

Haptics

2

Creating a new project

3

Linking to a 3rd party Library

4

Running your code on a phone

5

Wrap up

©2012 Immersion Corporation–Confidential
Haptic Effect Preview App
§  Free app on Google Play
§  Feel each effect on any
Android device
§  Code sample provided for
each effect
§  Awesome on Android
handsets with TouchSense
installed by Samsung, LG,
Toshiba, Pantech and others
§  Emulates effects on all other
Android devices without the
TouchSense technology

–  Allows vibe effects not available
with standard Google vibrate ()
method

©2012 Immersion Corporation–Confidential
Connect with Immersion
#HapticsDev

like “ImmersionDeveloper”

search “Immersion Corporation”

©2012 Immersion Corporation–Confidential
Some great Android resources
§  http://developer.android.com
§  http://stackoverflow.com
§  Various meetups –
§  http://www.meetup.com/Android-Career-TrainingChicago/
§  http://www.meetup.com/Newbie-Mobile-Developers/
§  http://www.momochicago.org/
§  http://www.meetup.com/chicago-google/
§  Have a great time with this!
©2012 Immersion Corporation–Confidential
Contact Us Hap+csDev@immersion.com	
  
Like Us hNp://www.facebook.com/ImmersionDeveloper	
  
Follow Us @Hap+csDev	
  
Read Our Blog hNp://blog.immersion.com	
  
Direct Access: Peter van der Linden
plinden@immersion.com

Bob Heubel
rheubel@immersion.com
©2012 Immersion Corporation–Confidential

40

More Related Content

What's hot

The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...
The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...
The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...ActiveState
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to androidbantyder
 
TMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasTMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasKJR
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopMichael Palotas
 
Kony-Cognizant Webinar: Finding the Silver Bullet in Retail Mobility
Kony-Cognizant Webinar: Finding the Silver Bullet in Retail MobilityKony-Cognizant Webinar: Finding the Silver Bullet in Retail Mobility
Kony-Cognizant Webinar: Finding the Silver Bullet in Retail MobilityKony, Inc.
 

What's hot (7)

seminar on androide
seminar on androideseminar on androide
seminar on androide
 
The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...
The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...
The True Cost of Open Source Software: Uncovering Hidden Costs and Maximizing...
 
DOCKER
DOCKERDOCKER
DOCKER
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
TMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael PalotasTMF2014 CI-CD Workshop Michael Palotas
TMF2014 CI-CD Workshop Michael Palotas
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery WorkshopAgile Bodensee - Testautomation & Continuous Delivery Workshop
Agile Bodensee - Testautomation & Continuous Delivery Workshop
 
Kony-Cognizant Webinar: Finding the Silver Bullet in Retail Mobility
Kony-Cognizant Webinar: Finding the Silver Bullet in Retail MobilityKony-Cognizant Webinar: Finding the Silver Bullet in Retail Mobility
Kony-Cognizant Webinar: Finding the Silver Bullet in Retail Mobility
 

Viewers also liked (8)

GDC 2014 talk Haptics Android
GDC 2014 talk  Haptics AndroidGDC 2014 talk  Haptics Android
GDC 2014 talk Haptics Android
 
Droidcon berlin Apr2013
Droidcon berlin Apr2013Droidcon berlin Apr2013
Droidcon berlin Apr2013
 
Grand finale
Grand finaleGrand finale
Grand finale
 
Code to go Android
Code to go AndroidCode to go Android
Code to go Android
 
Master cardapis v7.2020
Master cardapis v7.2020Master cardapis v7.2020
Master cardapis v7.2020
 
Master pass api
Master pass apiMaster pass api
Master pass api
 
Coding to the MasterCard OpenAPIs
Coding to the MasterCard OpenAPIsCoding to the MasterCard OpenAPIs
Coding to the MasterCard OpenAPIs
 
Intro to Android Programming
Intro to Android ProgrammingIntro to Android Programming
Intro to Android Programming
 

Similar to Putting real feeling into Android Apps

Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1Frank Pham
 
Android SDK and PhoneGap
Android SDK and PhoneGapAndroid SDK and PhoneGap
Android SDK and PhoneGapDoncho Minkov
 
Introductory webinar on iRidium
Introductory webinar on iRidiumIntroductory webinar on iRidium
Introductory webinar on iRidiumiRidiumMobile365
 
androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.pptBijayKc16
 
Introduction To Android For Beginners.
Introduction To Android For Beginners.Introduction To Android For Beginners.
Introduction To Android For Beginners.Sandeep Londhe
 
PhoneGap Application Development - Santhi J Krishnan
PhoneGap Application Development - Santhi J KrishnanPhoneGap Application Development - Santhi J Krishnan
PhoneGap Application Development - Santhi J KrishnanOrisysIndia
 
Android installation
Android installationAndroid installation
Android installationDurai S
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Javaamaankhan
 
Modifying Android Apps Without Source Code with Microsoft Visual Studio Code
Modifying Android Apps Without Source Code with Microsoft Visual Studio CodeModifying Android Apps Without Source Code with Microsoft Visual Studio Code
Modifying Android Apps Without Source Code with Microsoft Visual Studio CodeRonillo Ang
 
Mobile os by waqas
Mobile os by waqasMobile os by waqas
Mobile os by waqas8neutron8
 

Similar to Putting real feeling into Android Apps (20)

201505 beena v0
201505 beena v0201505 beena v0
201505 beena v0
 
Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1Bai thuc hanh lap trinh Android so 1
Bai thuc hanh lap trinh Android so 1
 
Drone sdk showdown
Drone sdk showdownDrone sdk showdown
Drone sdk showdown
 
Android
AndroidAndroid
Android
 
Mobile Web vs. Native Apps
Mobile Web vs. Native AppsMobile Web vs. Native Apps
Mobile Web vs. Native Apps
 
Gl android platform
Gl android platformGl android platform
Gl android platform
 
Android SDK and PhoneGap
Android SDK and PhoneGapAndroid SDK and PhoneGap
Android SDK and PhoneGap
 
Android course (lecture2)
Android course (lecture2)Android course (lecture2)
Android course (lecture2)
 
Introductory webinar on iRidium
Introductory webinar on iRidiumIntroductory webinar on iRidium
Introductory webinar on iRidium
 
androidPramming.ppt
androidPramming.pptandroidPramming.ppt
androidPramming.ppt
 
Introduction To Android For Beginners.
Introduction To Android For Beginners.Introduction To Android For Beginners.
Introduction To Android For Beginners.
 
Internship presentation
Internship presentationInternship presentation
Internship presentation
 
Bird.pdf
 Bird.pdf Bird.pdf
Bird.pdf
 
PhoneGap Application Development - Santhi J Krishnan
PhoneGap Application Development - Santhi J KrishnanPhoneGap Application Development - Santhi J Krishnan
PhoneGap Application Development - Santhi J Krishnan
 
Android installation
Android installationAndroid installation
Android installation
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Modifying Android Apps Without Source Code with Microsoft Visual Studio Code
Modifying Android Apps Without Source Code with Microsoft Visual Studio CodeModifying Android Apps Without Source Code with Microsoft Visual Studio Code
Modifying Android Apps Without Source Code with Microsoft Visual Studio Code
 
Mobile os by waqas
Mobile os by waqasMobile os by waqas
Mobile os by waqas
 
Android tio manual
Android tio manualAndroid tio manual
Android tio manual
 
Android tio manual
Android tio manualAndroid tio manual
Android tio manual
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Putting real feeling into Android Apps

  • 1. Peter van der Linden Android Technology Evangelist Jan 2014, Chicago NASDAQ: IMMR Putting Real Feeling Into Android apps! ©2012 Immersion Corporation–Confidential
  • 2. ■ Agenda 1 Haptics 2 Creating a new project 3 Linking to a 3rd party Library 4 Running your code on a phone 5 Wrap up ©2012 Immersion Corporation–Confidential
  • 3. 1 Haptics 2 Creating a new project 3 Linking to a 3rd party Library 4 Running your code on a phone 5 Wrap up ©2012 Immersion Corporation–Confidential
  • 4. The Mobile User ©2012 Immersion Corporation–Confidential 4
  • 6. Agency TBWANeboko Photo: Michael Harvey Touch feedback fills the human need for tactile gratification CBS News Photo: Walter Geis ©2012 Immersion Corporation–Confidential © 2011 Immersion Corporatio
  • 7. 1 Haptics 2 Creating a new project 3 Linking to a 3rd party Library 4 Running your code on a phone 5 Wrap up ©2012 Immersion Corporation–Confidential
  • 8. Android API levels http://goo.gl/LuNCDG ©2012 Immersion Corporation–Confidential
  • 9. Choosing Android API levels It’s a tradeoff •  You want the oldest possible API because – more phones will run your app •  You want the newest possible API because – better quality, better performance, widest range of new features Review market share of different API levels http://goo.gl/219Br4 API level 14 is a good choice at present, but will fade out. ©2012 Immersion Corporation–Confidential
  • 10. Create new project - Exercise To create a new Android project in Eclipse 1. start Eclipse 2. select File > New > Project. 3. expand “Android”, then click > Android Application Project, and click Next. 4. enter Application Name: Hello. 5. Enter Project Name: Helloworld 7. Package name: com.example.helloworld. 6. Select Min Reqd SDK: “API 14 Android 4.0” 7. Select Target SDK: “API 14” 9. Compile with: ”API 19” or any >= 14 where you have downloaded that platform Then hit ”Next” 10. on “New Android App” uncheck “custom launcher icon”, click “Next” 11. on “Create Activity”, click “Next”. 12. Click Finish. ©2012 Immersion Corporation–Confidential
  • 11. Create new project step 2 - 3 2. select File > New > Project… 3. expand “Android”, click > Android Application Project, click Next. Running your Studio Project ©2012 Immersion Corporation–Confidential
  • 12. Create a new Android project ■  File > New > Android Project using Eclipse + ADT Field Purpose Project name What Eclipse calls this app Hello Target API level this app uses 14 App name what phone calls the app Hello Package name what Java calls the app com.example.hello Activity name The file containing main MainActivity Min SDK version API level this app uses Value to use 14 You must have installed the platform file for “target” and “minsdk” level that you choose. This is part of installing the Eclipse bundle. Platforms live in the SDK & have names like “platform-14” ©2012 Immersion Corporation–Confidential
  • 13. Create new project step 4 - 9 4. enter Application Name: Hello. 5. Enter Project Name: Helloworld 7. Package name: com.example.helloworld. 6. Select Min Reqd SDK: “API 14 Android 4.0” 7. Select Target SDK: “API 14” 9. Compile with: ”API 14” or any >= 14 where you have downloaded that platform Then hit ”Next” Running your Studio Project ©2012 Immersion Corporation–Confidential
  • 14. Create new project step 10 10. on “New Android App,” uncheck “custom launcher icon”, click “Next” Running your Studio Project ©2012 Immersion Corporation–Confidential
  • 15. Create new project step 11 11. on “Create Activity”, click “Next”. 12. Click Finish. Running your Studio Project ©2012 Immersion Corporation–Confidential
  • 16. Create new project step 12 12. Note the “Activity name” and “layout name” you were given. Click Finish. ©2012 Immersion Corporation–Confidential
  • 17. New project appears in Eclipse You can expand folders by clicking right pointing triangle If project has errors, click Project > Clean > OK ©2012 Immersion Corporation–Confidential
  • 18. 1 Haptics 2 Creating a new project 3 Linking to a 3rd party Library 4 Running your code on a phone 5 Wrap up ©2012 Immersion Corporation–Confidential
  • 19. Downloading the Immersion Haptic Platform Immersion Haptic SDK Tools: www.immersion.com/haptic/sdk §  Download the Haptic SDK (450KB) §  Download the Haptic Studio (only for advanced custom effect design) Haptic Effects Quick Start Guide: www.immersion.com/haptic/guide Immersion Haptic Effect Preview App §  Download FREE from Google Play ©2012 Immersion Corporation–Confidential 19
  • 20. Add Haptics to “Hello World!” Project •  Download UHL zip file •  Copy extracted libImmEmulatorJ.so file to libs/armeabi folder (create folders if necessary) •  Copy extracted UHL.jar to libs folder ©2012 Immersion Corporation–Confidential 2 0
  • 21. Add a Button in res/layout/activity_main.xml <Button TextView! android:text=”play effect!”! android:onClick="handleClick"! />! in src/… MainActivity.java import android.view.View;! ! public void handleClick(View v) { }! ©2012 Immersion Corporation–Confidential 21
  • 23. Add Vibrate permission in top level AndroidManifest.xml <manifest xmlns:android= … />! ! <uses-permission! ! android:name="android.permission.VIBRATE" />! ! <application android:icon= ! <activity>! </activity>! </application>! ! </manifest>! ©2012 Immersion Corporation–Confidential 23
  • 24. Add Import Statement Import the UHL classes into your Activity in src/… MainActivity.java import com.immersion.uhl.*;! ©2012 Immersion Corporation–Confidential 24
  • 25. Instantiate Launcher object in src/… MainActivity.java public class MainActivity extends Activity {! ! Launcher haptic;! ! @Override! public void onCreate(Bundle b) {! super.onCreate(b);! haptic = new Launcher(this);! ©2012 Immersion Corporation–Confidential 25
  • 26. Use the Haptic Effect Preview App ©2012 Immersion Corporation–Confidential 26
  • 27. Play Effect public  sta+c  final  int  BOUNCE_100  =  0;      …   public  sta+c  final  int  EXPLOSION7=    79;   public  sta+c  final  int  ENGINE4_33  =  123; haptic.play(Launcher.EXPLOSION7);! ©2012 Immersion Corporation–Confidential 27
  • 28. Stop any rendering when app Pauses in src/… MainActivity.java @Override! !protected void onPause() {! ! !super.onPause();! ! !haptic.stop();! !}! ©2012 Immersion Corporation–Confidential 28
  • 29. Harden the code try {! ! haptic.play(Launcher.EXPLOSION7);! ! } catch (RuntimeException e) {! Log.e(”MyTestApp", e.getMessage());! }! ©2012 Immersion Corporation–Confidential 29
  • 30. In a nutshell, that’s it! That’s all you need to put haptics in your app Now you can add cool pre-made haptic effects to your game applications. ©2012 Immersion Corporation–Confidential 30
  • 31. Immersion Haptic SDK Plugins §  Unity3D plugin §  Marmalade plugin §  YoYo Games Plugins available at www.immersion.com/haptic/sdk ©2012 Immersion Corporation–Confidential 31
  • 32. 1 Haptics 2 Creating a new project 3 Linking to a 3rd party Library 4 Running your code on a phone 5 Wrap up ©2012 Immersion Corporation–Confidential
  • 33. One time set up – using phone/tablet Eclipse ADT Eclipse plugin SDK Run As > Android Application workspace your app code platform library ©2012 Immersion Corporation–Confidential actual device
  • 34. One time set up – PHONE / TABLET Home > All Apps > Settings •  Applications > Development •  Click “USB Debugging” & “Stay awake” •  Different in Ice Cream Sandwich (Dev options) •  Different in Jelly Bean (Hidden! click “build num” 7x) actual device Pull down Notification Shade > USB Connection •  Click “Charge only”, “OK” Connect the device to your devt PC with a micro USB cable If using Windows, you need to install a driver on Windows. Get it from phone manufacturer’s developer website. ©2012 Immersion Corporation–Confidential
  • 35. Run app on phone / tablet ©2012 Immersion Corporation–Confidential
  • 36. 1 Haptics 2 Creating a new project 3 Linking to a 3rd party Library 4 Running your code on a phone 5 Wrap up ©2012 Immersion Corporation–Confidential
  • 37. Haptic Effect Preview App §  Free app on Google Play §  Feel each effect on any Android device §  Code sample provided for each effect §  Awesome on Android handsets with TouchSense installed by Samsung, LG, Toshiba, Pantech and others §  Emulates effects on all other Android devices without the TouchSense technology –  Allows vibe effects not available with standard Google vibrate () method ©2012 Immersion Corporation–Confidential
  • 38. Connect with Immersion #HapticsDev like “ImmersionDeveloper” search “Immersion Corporation” ©2012 Immersion Corporation–Confidential
  • 39. Some great Android resources §  http://developer.android.com §  http://stackoverflow.com §  Various meetups – §  http://www.meetup.com/Android-Career-TrainingChicago/ §  http://www.meetup.com/Newbie-Mobile-Developers/ §  http://www.momochicago.org/ §  http://www.meetup.com/chicago-google/ §  Have a great time with this! ©2012 Immersion Corporation–Confidential
  • 40. Contact Us Hap+csDev@immersion.com   Like Us hNp://www.facebook.com/ImmersionDeveloper   Follow Us @Hap+csDev   Read Our Blog hNp://blog.immersion.com   Direct Access: Peter van der Linden plinden@immersion.com Bob Heubel rheubel@immersion.com ©2012 Immersion Corporation–Confidential 40