Você está na página 1de 32

Mobile

Sensing Tutorial 1
April 23, 2014

WSN Wireless Sensor Networks Lab


Paul Baumann, M.Sc.


paul.baumann@wsn.tu-darmstadt.de

Prof. Dr. Silvia San>ni
san2nis@wsn.tu-darmstadt.de
Image source: h:p://www.addle:ers.com/bart-simpson-generator.htm

What are we going to do today


Administra2ve issues

New room and lecture schedule


Details on tutorials and project registra2on

Crea2ng an Android project

Wifun rst steps aka HelloWorld

Get familiar with the Emulator

Run the app on the Android emulator

Mobile phones distribu2on

Run the app on the mobile phones


2

New schedule and room


High number of students interested in a:ending the
lecture
*200* students registered in TUCaN as of April 23, 2014,
12 p.m. (CET)

Wednesday:
14:25 16:05
S306/051

Thursday:

14:25 16:05
S306/051
3

Group registra>ons for the tutorials and project


We received 52 group registra2ons before the deadline!
We accept ALL registered groups
BUT:

Limited amount of hardware (max. 30 phones vs. 52 groups)


Dras2c changes in the project modali2es to cope with the high
number of groups

Solu2on: WE NEED YOUR HELP!


If one of the group members has an Android phone with
at least API17, please be fair and use your own phone
In this case, the phone reserved for your group will be given to
the next group!

Class tutorials (aka exercises)


Step-by-step, hands-on tutorials on Android
programming
~Every week from now un2l ~mid June

During each exercises, we will program a new part of


our Android app Wifun
For today and tomorrow, we start with a (very!) simple
"HelloWorld" applica2on

There will be no "homework"

But you MUST have the code of the previous tutorials up and
running when you come to class
5

Wifun: Our "fun" mobile sensing app


Wifun: Wi-Fi Unplugged
Use Wi-Fi module to detect Wi-Fi signals in the
environment
Wi-Fi scans

Use the Wi-Fi scans for own goals, without need for a
3rd party service
Unplugged

This will become clear(er)


during the next tutorials.

Tutorials and project roadmap


Date

Code name

Topic

Wed, April 23, 2014

Wifun-1

Android installa2on help + Hardware release

Thu, April 24, 2014

Wifun-2

Hello (Android) World

Wed, April 30, 2014

Wifun-3

Sensors + Basic concepts

Wed, May 14, 2014

P1

Introduc2on to Mobile Sensing project

Wed, May 21, 2014

Wifun-4

Google Maps + Local storage

Wed, May 28, 2014

Wifun-5

Implemen2ng human mobility predic2on


algorithms on mobile phones

Thu, June 5, 2014

P2

In-class programming (project)

Wed, June 25, 2014

Wifun-6

Implemen2ng ac2vity recogni2on algorithms on


mobile phones

Thu, June 26, 2014

P3

In-class programming (project)

Thu, July 3, 2014

P4

In-class programming (project)

Starter-app for each tutorial


Just unzip and import into your Eclipse

Technical support
Why

If you have technical issues to discuss about the content


exercises (but you could not solve them using the forum!)

How

Send an e-mail to: teaching@wsn.tu-darmstadt.de


Not later than 24 hours before the intended appointment
(= at least 1 day in advance)
Briey describe your problem when asking for an appointment

Create an Android Project Wifun

Let's write our rst Android program


In Eclipse, choose

FileNewAndroid (Applica2on) Project

If Android (Applica2on) Project is not in the main list


FileNew->Other

10

Dene a project
Project name

Meaningful, representa2ve ProjectName

Use the CamelCase


naming convention
for your project
name.

Build target

Tell Eclipse which version of the Android planorm


you are building for
Do NOT choose the targets named Google API

Project proper2es

Applica2on name
Package name
Ac2vity name (op2onal)
Minimum SDK version (API level)
11

Dene a project (I)

Be careful, the view


may differ if you use an
older eclipse version

12

Dene a project (II)

Use default values

13

Created project

14

Project proper>es for our Wifun App


Project name: Wifun
Build target: Android 4.2.X (API level 17)
Applica2on name: Wifun
Package name: <choose.your.package.name>
(Example: de.darmstadt.tu.wsn)

Create Ac2vity: ja

Use reverse domain


name notation
whenever possible

Minimum SDK: 14
15

Deploy the applica>on

16

Need to create a new emulator

17

Set up a new emulator

Be careful, the view


may differ if you use an
older eclipse version

1. Click on new
2. Set properties

Be careful!
18

Run the Wifun app (again)

19

Wait for the emulator to boot (takes >me)

20

Keep wai>ng

21

Eureka!

22

Adjust the size of the emulator window


In Eclipse

Window -> AVD Manager -> Virtual Devices

Select the AVD you want to launch and click Start


Check the "Scale display to real size" bu:on
Enter how big you want the window to appear in inches
E.g., 7 inches, 108 dpi

Press Launch

23

Adjust the size of the emulator window (demo)

24

Hardware release Mobile phones

Group registra>ons for the tutorials and project


We received 52 group registra2ons before the deadline!
We accept ALL registered groups
BUT:

Limited amount of hardware (max. 30 phones vs. 52 groups)


Dras2c changes in the project modali2es to cope with the high
number of groups

Solu2on: WE NEED YOUR HELP!


If one of the group members has an Android phone with
at least API17, please be fair and use your own phone
In this case, the phone reserved for your group will be given to
the next group!

26

Registered groups (1)


Group number

Group name

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Droid Freaks
The Beamers
You Don't Know Jack
Jelly Beans
Sensory Minds
JAM
Crouching Tiger, Hidden Dragon
Andy Rubin
Swordfish
DroidNinjas
Business Home Navigation
Quest
PHOENIX
Avid Gamers
sense-ation
Meluhas'
CONSTANTINE
TROY
27

Registered groups (2)


Group number

Group name

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Dark Horses
AndriodNewBies
The Visualizers
Victory
Andrommers
Spartans
Driod busters
minas tirith
Here for Beer
Spurs winner
Nexus
Naan Pakorey
Gintama
DoCoMo
Strikers
KM1908
Maverick
MexTech
28

Registered groups (3)


Group number

Group name

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52

inertia
Ellipsis
Vandelay Industries
H2V
Alpha
Ramanujan
Persian Gulf
The Jelly Beans
AndroiST
Pfusch Industries
Oktoberfest
AndroDevTeam
Signalianz
FireCracker
The Athenians
The Fellowship Of Delvik

29

References
[Gargenta 2011] Marko Garenta. Learning Android: Building Applica2ons for the
Android Market. O'Reilly Media. 1st Edi2on, March 2011
[Dev] Android Developers blog. h*p://android-developers.blogspot.com
[Guys] Android Guys. www.androidguys.com


30

Acknowledgments
The following sources or authors have directly or
indirectly contributed (through their ideas, papers,
presenta2ons, and more) to the realiza2on of these
slides:
Marko Gargenta
and others.

31

Quote of the day (April 23)

"There are no secrets. It is a lot of


people doing a lot of work"
Google developer
(during a dinner at the Googleplex
in Mountain View, CA, USA, in January 2011)

32

Você também pode gostar