Upload
curry
View
53
Download
9
Embed Size (px)
DESCRIPTION
PROGRAMOWANIE URZ Ą DZE Ń MOBILNYCH rodzaje urz ą dze ń mobilnych - telefony komórkowe, smartfony - komputery typu palmtop ( handheld, pocket PC, Personal Digital Assistant ) - tablety - urz ą dzenia specjalizowane (nawigacyjne, inwentaryzacyjne ... ). - PowerPoint PPT Presentation
Citation preview
PROGRAMOWANIE URZĄDZEŃ MOBILNYCH
rodzaje urządzeń mobilnych
- telefony komórkowe, smartfony
- komputery typu palmtop ( handheld, pocket PC, Personal Digital Assistant )
- tablety
- urządzenia specjalizowane (nawigacyjne, inwentaryzacyjne ... )
systemy programowania: Java Virtual Machine
- CLDC ( Connected Limited Service Configuration )
- MIDP 1.0, 2.0 ( Mobile Information Device Profile )
systemy operacyjne
- PalmOS ( Garnet OS )
- Symbian, EPOC ( Psion )
- Windows : CE ; Mobile 2003, 5.0, 6.0, 6.1,
Phone 7.0 , 8.0- Andriod ( Linux )
- MeeGo Core Software Platform (Intel/Nokia/Linux)
- iOS ( iPhone OS )
wyposażenie
- łącza komunikacyje
GSM (GPRS, EDGE, HSDC, LTE),
WiFi, Bluetooth, USB, IrDA, TransferJet
- odbiornik GPS
- NFC (RFID)
- czujniki :
oświetlenia, żyroskop, kompas, akcelerometr
- klawiatura
- aparat fotograficzny / kamera
- radio
usługi
- rozmowy telefoniczne
- multimedia
- internet
- aplikacje
zastosowania (niektóre)
- lokalizacja, nawigacja
- akwizycja
- pozyskiwanie informacji
- pomiary
tworzenie aplikacji Windows Mobile
- ActiveSync
- Remote Display Control
- Visual Studio.NET 2008
- NET Compact Framework 3.5
- wspomaganie uruchamiania
- usuwanie
- testowanie zasobówMicrosoft.WindowsMobile.Status.SystemProperty. CameraPresent.Equals(1)
// using Microsoft.WindowsMobile.Status;
TT, Egzamin, Camera
Baza Danych SQL Mobile
string dbPath = @"\My Documents\indeks.sdf";
string makeDbPath = @"\My Documents\makeDb.sql";
if(System.IO.File.Exists(makeDbPath))
{
System.Data.SqlServerCe.SqlCeEngine engine = new SqlCeEngine("Data Source = " + dbPath);
engine.CreateDatabase();
SqlCeConnection dbConnection = new SqlCeConnection("Data Source = " + dbPath);
dbConnection.Open();
}
// View groups
System.Data.SqlServerCe.SqlCeDataReader reader = null;
string queryText = "SELECT * FROM groups order by name";
SqlCeCommand query = new SqlCeCommand (queryText, dbConnection);
reader = query.ExecuteReader();
groupsListBox.Items.Clear();
ListViewItem ListItem = null;
while(reader.Read())
{ ListItem = new ListViewItem();
ListItem.Text = reader["name"].ToString();
ListItem.SubItems.Add(reader["id"].ToString());
groupsListBox.Items.Add(ListItem);
}
reader.Close();
GPS : Global Positioning System
- ok. 30 satelitów, - orbity kołowe, ok. 20 000 km nad Ziemią- naziemne stacje nadzorujące- komunikaty : { TN , Z , h , . . . }
• S
ZOx
d h
d = c * ( TO – TN ) x = sqrt ( d2 – h2 )
• ZO
x • Z2
O2
x2
• Z1
O1
x1
- dokładność : 4 – 12 m
- czas przesłania komunikatu : ok. 70 ms
- różnica czasów dla 1 km : ok. 3 µs
- polepszanie dokładności : stacje bazowe
- ASG-EUPOS : 3 cm
- POZGEO i POZGEO-D : 1 mm
- przyspieszenie lokalizacji : A-GPS
współpraca z operatorem telefonii komórkowej
Odbiornik GPS
- włączany programowo, COMx
standard
National Marine Electronics Association ( NMEA )
http://www.gpsinformation.org/dale/nmea.htm
- sekwencje znaków ( sentences )
- nagłówki $GP (ok. 30 rodzajów)
GGA : czas + współrzędne + wysokość npm
GSA, GSV : dane satelitów
ZDA : data + czas
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
Where:
GGA Global Positioning System Fix Data
123519 Fix taken at 12:35:19 UTC
4807.038,N Latitude 48 deg 07.038' N
01131.000,E Longitude 11 deg 31.000' E
1 Fix quality: 0 = invalid
1 = GPS fix (SPS)
2 = DGPS fix
3 = PPS fix
4 = Real Time Kinematic
5 = Float RTK
6 = estimated (dead reckoning) (2.3 feature)
7 = Manual input mode
8 = Simulation mode
$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
08 Number of satellites being tracked
0.9 Horizontal dilution of position
545.4,M Altitude, Meters, above mean sea level
46.9,M Height of geoid (mean sea level) above WGS84
ellipsoid
(empty field) time in seconds since last DGPS update
(empty field) DGPS station ID number
*47 the checksum data, always begins with *
GPSR, LonLat
biblioteka GPS Intermediate Driver
- główne klasy
GPS – reprezentuje odbiornik
GpsDeviceState – stan odbiornika
GpsPosition – pozycja geograficzna
DeegreesMinutesSeconds – konwersja
xx,xxxº xxº yy' zz''
- zdarzenia
deviceStateChanged ( GpsDeviceState )
locationChanged ( GpsPosition )
GpsDeviceState device = null;
GpsPosition position = null;
Gps gps = new Gps();
//
private void startGps(object sender, EventArgs e)
{ if (!gps.Opened)
{ gps.Open(); } }
private void stopGps (object sender,
EventArgs e)
{ if (gps.Opened)
{ gps.Close(); } }
string UpdateData(object sender, System.EventArgs args) {
string str = "";
if (gps.Opened)
{
if (position != null)
{
if (position.LatitudeValid)
str += "Latitude (D,M,S):\n " +
position.LatitudeInDegreesMinutesSeconds + "\n";
if (position.LongitudeValid)
str += "Longitude (D,M,S):\n " +
position.LongitudeInDegreesMinutesSeconds + "\n";
}
}
return str;
}
Wiadomości SMS wysyłanie
SmsMessage sms = new SmsMessage(number, text);
sms.Send();
odbieranie
interceptor = new MessageInterceptor();
interceptor.InterceptionAction =
InterceptionAction.NotifyAndDelete;
interceptor.MessageReceived += newMessageInterceptorEventHandler(OnSmsReceived);
private void OnSmsReceived
(object sender, MessageInterceptorEventArgs e)
{
SmsMessage msg = (SmsMessage)e.Message;
textBox1.Text = msg.From.Address;
textBox2.Text = msg.Body;
}
SMS
Sieć Internet (transmisja GPRS)
sprowadzanie stron WWW
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(pageUri);
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
StreamReader sr = new
StreamReader(resp.GetResponseStream());
pageData = sr.ReadToEnd();
sr.Close();
GetPage (bez USB)
Sieć bezprzewodowa WiFi
WiFiMail
klient
TcpClient client = new TcpClient();
client.Connect(server, port);
NetworkStream stream = client.GetStream();
//
stream.Write(outData, 0, outData.Length);
//
stream.Read(inData, 0, inData.Length);
serwer
IPEndPoint LEP = new IPEndPoint( IPAddress.Any, 5000);
TcpListener listener = new TcpListener( LEP );
listener.Start();
TcpClient New = listener.AcceptTcpClient();
NetworkStream streamX = New.GetStream();
//
streamX.Write(outData, 0, outData.Length);
//
streamX.Read(inData, 0, inData.Length);
Łącze Bluetooth
porty szeregowe COM
klucz sieciowy
otwarcie portu
serialPort1.Open(); // PDA:COM5, PC:COM7
wysłanie tekstu
serialPort1.WriteLine(text);
odczytanie tekstu
void serialPort1_DataReceived (object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{ data = serialPort1.ReadExisting(); } BT
serwisy internetowe : jak dla PC
gniazda TCP / UDP : jak dla PC
pliki XML : jak dla PC
Aplikacja Kelnerska kuchnia
Potrawy
Nazwa
Cena
Liczba
ID_P
Kelnerzy
Imię
Utarg
ID_K
Zamówione dania
Razem
Gotowe
Nazwa
Cena
Liczba
ID_P
kelner
Potrawy Zamówione dania
Razem
Gotowe
komunikacja
- kelner
ID_K REZ ID_P
ID_K ZWR ID_P
ID_K ZAM ID_P ID_P ... ID_P
- kuchnia
ID_K ODR