O ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARNI RIVOJLANTIRISH VAZIRLIGI

Size: px
Start display at page:

Download "O ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARNI RIVOJLANTIRISH VAZIRLIGI"

Transcription

1 O ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARNI RIVOJLANTIRISH VAZIRLIGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI URGANCH FILIALI Kompyuter injiniringi fakulteti Dasturiy injiniring kafedrasi ХO JAYEV O., QURYAZOV D. Yo nalish: «Mobil ilovalarni ishlab chiqish» fanidan tajriba ishlarini bajarish bo yicha USLUBIY KO RSATMA Kompyuter injiniringi (Kompyuter injiniringi) Dasturiy injiniring III Kurs V Semestr Urganch 2016

2 Xo jayev O., Quryazov D. Mobil ilovalarni ishlab chiqish fanidan tajriba ishlarini bajarish bo yicha uslubiy ko rsatma. Urganch, TATU Urganch filiali, b. Mobil ilovalarni ishlab chiqish fanidan tajriba ishlarini bajarish bo yicha uslubiy ko rsatma, bakalavriatura bosqichining, Kompyuter injiniringi (Kompyuter injiniringi), Dasturiy injiniring, yo nalishini 3 bosqich talabalari uchun mo ljallangan. Talabalar, ushbu uslubiy ko rsatmani o qish davomida V semestrda o qitiladigan, Ma lumotlarni intellektual taxlili fanidan tajriba mashg ulotlarini o tkazish ko nikmasiga ega bo ladilar. Taqrizchilar: TATU Urganch filiali, Axborot ta lim texnologiyalari kafedrasi dotsenti A.Ashirova TTA Urganch filiali, Normal fiziologiya, biofizika va informatika kafedrasi mudiri t.f.n. Raximov B.S..

3 Mundarija 1. Lobarotoriya mashg`uloti 1 Android uchun dasturchi ishchi muhitini sozlash 2. Lobarotoriya mashg`uloti 2 Androidda Layoutlar bilan ishlash 3. Lobarotoriya mashg`uloti 3 Activitylar orasidagi munosabat 4. Lobarotoriya mashg`uloti 4 Ro yhatlar bilan ishlash. Nostandart ro yhatlar(listview) 5. Lobarotoriya mashg`uloti 5 Ma lumotlarni qurilmada saqlash. Ichki va tashqi xotiradan foydalanish 6. Lobarotoriya mashg`uloti 6 SQLite MBBT bilan ishlash 7. Lobarotoriya mashg`uloti 7 JSON ga asoslangan Web xizmatlar bilan integratsiya 8. Lobarotoriya mashg`uloti 8 Geografik joylashuv o rnini aniqlash. Google maps bilan integratsiya. Lobarotoriya mashg`uloti 1 Mavzu: Android uchun dasturchi ishchi muhitini sozlash.

4 Maqsadlar: Mobil qurilmalar uchun dasturiy ta'minot tizimlarini rivojlantirish va tashkil etish, android muhitida dasturiy ta'minot ishlab chiqish uchun zarur bo'lgan vositalar majmuyini o'rganish. Nazariy qism: Android nima?: Android Linux operatsion tizimi yadrosi asosida ishlab chiqilgan bo`lib, ochiq kodli tizim hisoblanadi. Android operation tizimi Google kompaniyasining mahsuloti hisoblanadi. Android ning birinchi platformasi 2007 yil (beta versiya) Google komponiyasi tamonidan ishlab chiqilgan Android 1.0 versiyasi hisoblanadi. Android operatsion tizimini biz quyidagi holatlarda muhim ro`l o`ynashini kuzatishimiz mumkin : Android ning yaratilish bosqichlari : 1-qadam - Setup Java Development Kit (JDK) Siz oldin Java JDK ni shaxsiy kompyuteringizga yuklab olishingiz kerak bo`ladi, o`zgarishini holatini saqlab olishingiz kerak bo`ladi. O`zgaruvchilar muhitida JAVA_HOME qilib yangi holatni ochib, C:\jdk1.7.0_15\bin manzil kiritiladi. So`ng cmd ga javac buyrug`ini berib tekshirib olamiz.

5 set PATH=C:\jdk1.7.0_15\bin; %PATH% set JAVA_HOME=C:\jdk1.7.0_15 Java Development Kit ni o`rnatib olganimizdan so`ng keying bosqichga o`tamiz. 2-qadam - Android SDK ni o`rnatish. Bu bosqichda siz android sdk ni yuklab olishingiz kerak bo`ladi. Software Development Kit ni oxirgi versiyasini yuklab olganingizdan so`ng shaxsiy kompyuteringizga o`rnatishingiz lozim bo`ladi va u quyidagicha ekran ochib beradi : Android SDK ni paketlarini o`rnatishni boshlashingiz mumkin, kamida Windows muhitida bo`lsangiz 7 paketdan kam bo`lmagan platformalarni o`rnatib olishni tavsiya qilamiz. 3-qadam - Android Studio ni o`rnatish. Android Studio ochiq kodli tizim android uchun dasturiy ta`minotlarni yaratishni imkonini yaratib beruvchi komplyator hisoblaadi. Android Studio dasturi IntelliJ IDEA asosi ostida qurilgan. android-studio-bundle windows.exe. ushbu dasturiy ta`minotni yuklab olib android studio ni ishga tushirishingiz mumkin. O`rnatish jarayoni :

6 JDK ni o`rnatilgan joyini ko`rsatib yuborishingiz kerak bo`ladi : Keyingi bosqichda Android Studio ni komponentalarini o`rnatib olishingiz mumkin, Android SDK, Virtual mashina, Intel protsessori uchun komponentalar. Android Studioni qayerga o`rnatish lozim deb bilsangiz shu yerni ko`rsatib yuborishingiz, shuningdek SDK ni yo`lini ham ko`rsatib o`tishingiz kerak bo`ladi.

7 Kopyuteringizni operativ xotirasidan qancha miqdorda joy ajratishingizni belgilashingiz kerak. Bosqichlarni bajarib bo`lganingizdan so`ng Android Studioni ishga tushirishingiz mumkin. Bu oyna orqali siz Android Studioda o`zingizni birinchi dasturingizni yaratib olishingiz, proyektni import qilishingiz va boshqa holatlarda dasturiy ta`minotlar bilan ishlay olish imkiniyatini yaratib beradi. Loyiha yaratish bosqichma bosqich amalga oshiralaveradi :

8 1) 2) 3) Yuqoridagi bosqichlardan so`ng sizga quyidagicha yangi darcha ochib beradi va bu sizning birinchi yaratgan android ichshi muhitida ishlovchi dasturingizni jo`rinishidir:

9 Siz bu dasturiy ta`minotni ishga tushirishingiz uchun Android Virtual Manager ni ishga tushirishingiz kerak bo`ladi: Emulatorni ishga tushirib bo`lib dasturingizga Run (Ishga tushirishingiz) mumkin. Vazifalar : Har bir talaba variyantda keltirilgan misollarni grfik interfaceni ishlashtishi kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish

10 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20 klient dasturini ko`rinishi Mavzu: Androidda Layoutlar bilan ishlash. Lobarotoriya mashg`uloti 2 Ishdan maqsad: Androidda layoutlar bilan ishlashni, grafik va foydalanuvchi interfacelar bilan ishlashni o`rganish. Nazariy qism : Android - UI Layout Layoutlar bilan ishlagan vaqtda androidning maxsus komponentalari bilan ishlashga to`g`ri keladi. Bu komponentalar user interfaceni visualniy ko`rinishda yasashga imkoniyatlar yaratib beradi.

11 Tashqi ko`rinish: Androidda layoutlar bir necha xil bo`lishi mumkin. Quyidagi misolda siz LinearLayoutga xususiy holat uchun keltrilgan misolda ko`rishingiz mumkin. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="this is a TextView" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="this is a Button" /> <!-- More GUI components go here --> </LinearLayout> Har bir xml ko`rinishning o`ziga bo`glangan java fayli mavjud bo`ladi va u quyidagi metod yordamida bog`lanadi: public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

12 setcontentview(r.layout.activity_main); Layout ko`rinishlar haqida qisqacha ma`lumot: Layout & Ma`lumot 1 Linear Layout Orientatsiyasi belgilash orqali linearlayout ichiga kiritilgan atributlarni belgilash imkonini yaratadi. 2 Relative Layout RelativeLayout komponentalarni har xil positsiyada joylashtirish mumkin 3 Table Layout TableLayout jdaval ko`rinishda joylashtirish mumkin. 4 Absolute Layout

13 AbsoluteLayout bu aniq joyini x va y o`qlarida belgilab olish mumkin. 5 List View ListView itemlarida satrlar bilan ishlash imkonini yaratib beradi 6 Grid View GridView ViewGroup guruhiga kirib satr va ustunlarda har xil ob`yektlar bilan ishlash imkoniyatini yaratib beradi.

14 Layout atributlari : Atributlar obyektlarni xususiyatlarini belgilashda kerak bo`ladi. Shunday atbutalar mavjudki, hamma obyektlarga ham to`g`ri keladi, ayrimlari esa faqat o`ziga tegishli bo`ladi. Layoutlar attributalariga misollar Atributlar Qisqacha ma`lumot android:id Obyektni identefikatsion nomini belgilash android:layout_width Obyektni enini belgilash android:layout_height Obyektni bo`yini belgilash android:layout_margintop Obyektni positsiyasini yuqoridan pastga qarab surish android:layout_marginbottom Obyektni positsiyasini pastidan yuqoriga qarab surish android:layout_marginleft Obyektni positsiyasini chapdan o`nga qarab surish android:layout_marginright Obyektni positsiyasini o`ngdan chapga qarab surish

15 android:layout_gravity Joylashuv o`rnini belgilash android:layout_weight Obyekt vazni, ya`ni eni va bo`yicha ajdod layoutdan olgan xususiyati android:layout_x Layout da x koordinatasi bo`yicha belgilash android:layout_y Layout da y koordinatasi bo`yicha belgilash android:paddingleft Obyektlarni chapga o`zidan itarish android:paddingright Obyektlarni o`nga o`zidan itarish android:paddingtop Obyektlarni yuqoriga o`zidan itarish android:paddingbottom Obyektlarni pastga o`zidan itarish Vazifalar : Har bir talaba Android muhitida o`zining shaxsiy dasturiy ta`minotini ishga tushirishirishi lozim. Xml ko`rinishini tuzishlari kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish

16 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20. mail klient dasturini ko`rinishi Mavzu: Activitylar orasidagi munosabat. Lobarotoriya mashg`uloti 3 Ishdan maqsad: Androidda activitylar bilan munosabatni o`rganish, ular orasidagi bog`lanishlarni ko`rib chiqish. Nazariy qism: Activtylar. Har qanday mobile dasturiy ta`minotlar activitylar va unga biriktirilgan Java fayllar bilan ishlanadi. Activitylar deganda biz user interfaceni tushunishimiz mumkin, ya`ni ularda joylashgan har xil turdagi komponenetalarni bir-birlari bilan bog`liqliligini umumiy holatda biror bir list shaklida ko`rish degani. Odatda dasturiy ta`minotlarimiz bir nechta activity.xml fayllarni birlashmasidan tashkil topgan bo`ladi. Activitylar bilan ishlaganimizda har safar qilgan harakatimizni xotirasida saqlab qoladi va oxirgi qilgan harakatimizni birinchi navbatda saqlab qoladi. Agar siz orqaga qaytsangiz oxirgiz bajargan amallaringizga qaytadi. Activity yaratish: Loyiha yaratgan vaqtimizda bizga xususiy holda activity_main.xml faylini yaratib beradi. MainActivity.java faylida esa bir nechta metodi yordamida interface fayliga birlashtirilib qo`yiladi va ular quyidagilar:

17 Metodlar oncreate() Qisqacha ma`lumot Bu metodda siz activitylarni o`rtasidaga harakatni boshqarishingiz mumkin masalan bir-birlari bilan bog`lash.java faylni activity_main.xml fayli bilan bog`lashda asosan qo`llaniladi. Harakatni to`xtatish Yo`q Keyin onstart() onrestart() Agar harakat to`xtatib qo`yilgan bo`lsa qaytadan yuklab olish imkoniyatini yaratib beradi. Yo`q onstart() onstart() Qayta ishchi rejimiga tushirishda qo`llaniladi, agar to`xtatilgan bo`lsa Yo`q onresume() yoki onstop() onresume() Oldingi holatga qaytarish, to`xtatilgan bo`lsa, shu metoddan foydalaniladi Yo`q onpause() onpause() Biror bir harakatni to`xtatib qo`yish, uning biror bir amallar majmuyini vaqtinchalik stop berib qo`yishimiz mumkin.biz uning oxirgi faoliyatini shu joyidan qaytarmasak u onresume() metodi holatida saqlanib qolaveradi. Ha onresume() yoki onstop() onstop() Bu metod onresume() metodidan farqli jihati oxirgi bajarilingan harakatni butunlay to`xtaib qo`yadi. Qayta ishga tushurmaguncha shu holat saqalanib qolaveradi. Ha onrestart() yoki ondestroy() Ushbu metodlar dasturimizni hayot skilini davomiyligini ta`minlash uchun keng qo`llaniladi va ular quyidagi holatlarda ishlatilinadi : public class ExampleActivity extends Activity public void oncreate(bundle savedinstancestate) { protected void onstart() { super.onstart();

18 @Override protected void onresume() { protected void onpause() { protected void onstop() { protected void ondestroy() { super.ondestroy(); Realizatsiya qilish: User interfacelar ierarik ko`rinishda shakllandi. XML ko`rinishlarni yasash uchun visual tarzda obyektlarni listga qo`yigan holatda joylashtirishingiz mumkin. Bu obyektlar bo`lishi mumkin: Button, EditText, TextView, CheckBox, ListView va h.k. Bu obyektlar ViewGroup tizimi deb ham ataladi. Activitylardagi komponenetalar grafik yoki kodli ko`rinishlarda tasvirlanadi. Java qismida esa Obyektlarni shu activity uchun faollashtib qo`yiladi. AndroidManifest da ushbu activity_main.xml va unga birlashtilgan java fayllarni faollashtib qo`yish lozim bo`ladi. <application> element. For example: <manifest... > <application... > <activity android:name=".exampleactivity" />

19 ... </application... >... </manifest > Siz bu AndroidManifest qismida android dasturingizni ko`pgina paramertlarini kiritshingiz, tizimga ta`siri haqda tanishtirish imkoniyati mavjuddir. Masalan: Siz ushbu misolda ikki activity orasidagi munosabatni ko`rishingiz mumkin: Birinchi activityning java fayli - "GetMessageActivity.java", ikkinchisiniki esa DisplayMessageActivity.class deb nomlansin. package...; import...; import android.widget.toast; public class GetMessageActivity... { public final static String EXTRA_MESSAGE = "com.example.testintent.message"; private int requestcode = public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_get_message); public void sendmessage(view view) { // Retrieve the message entered EditText txtmessage = (EditText) findviewbyid(r.id.txtmessageid); String message = txtmessage.gettext().tostring(); Intent intent = new Intent(this, DisplayMessageActivity.class); intent.putextra(extra_message, message); startactivityforresult(intent, requestcode); public void onactivityresult(int resultrequestcode, int resultcode, Intent result) { if (resultrequestcode == requestcode) { if (resultcode == RESULT_OK) { Toast.makeText(this, result.getdata().tostring(), Toast.LENGTH_LONG).show();......

20 display_message_activity.xml ning ko`rinishi quyidagicha: <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true" android:onclick="returnmessage" /> </RelativeLayout> Bu misolda ikki activity ga edittext obyekti yordamida matn yuborishni ko`rib chiqamiz: OnClick() metodi yodamida Button da returnmessage() ni qaytaramiz. res\values\string.xml katalogida joylashgan string.xml fayliga <string name="btnreturnlabel">return</string> ni kiritamiz. Endi DisplayMessageActivity.java faylini yaratib quyidagicha yozib chiqamiz: package...;

21 import android.net.uri; importandroid.view.view; importandroid.widget.edittext; public class DisplayMessageActivity... public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_display_message); Intent intent = getintent(); String message = intent.getstringextra(getmessageactivity.extra_message); TextView txtdisplay = (TextView) findviewbyid(r.id.txtdisplayid); txtdisplay.settext(message); public void returnmessage(view view) { Intent result = new Intent(); EditText txtreturn = (EditText) findviewbyid(r.id.txtreturnedid); String returnmessage = txtreturn.gettext().tostring(); result.setdata(uri.parse(returnmessage)); setresult(result_ok, result); finish(); Va biz quyidagi natijaga erishishamiz: Vazifa: Ushbu laboratoriya mashg`ulotida har bir talaba o`ziga berkitilgan topshiriqni activitylar orasidagi munosabatlarni qatnashtirib ishlashi lozim. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish ->

22 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20 klient dasturini ko`rinishi Lobarotoriya mashg`uloti 4 Mavzu: Ro yhatlar bilan ishlash. Nostandart ro yhatlar(listview). Ishdan maqsad: ListView larni ishlatishlarni o`rnatish o`rganish. Ro`yhatlar bilan ishlashni o`rganish. Nazariy qism: ListView lar ni ushbu laboratoriyada ikki xil turini ko`rib chiqamiz: Standart listviewlar va Nostandrat listviewlar. ListViewga misol keltiramiz Eng sodda listviewlar ArrayAdapter yordamida massivga olinadi. ArrayAdapterning itemlariga yuklanadigan textlarni shu massivga olib qo`yish mumkin.activity_main.xml faylida listview ga idni beramiz. setadapter () metodi yordamida ArrayAdapter() gi matnlarni joylashtiramiz. Xml faylning ko`rinishi: <LinearLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent"

23 android:layout_height="match_parent" android:orientation="vertical"> <ListView </ListView> </LinearLayout> android:layout_width="match_parent" android:layout_height="wrap_content" > Shunga mos MainActivity.java fayl ham quyidagicha : import android.os.bundle; import android.app.activity; import android.widget.arrayadapter; import android.widget.listview; public class ListActivity extends Activity { private String[] monthsarray = { "JAN", "FEB", "MAR", "APR", "MAY", "JUNE", "JULY", "AUG", "SEPT", "OCT", "NOV", "DEC" ; private ListView monthslistview; private ArrayAdapter public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_list); monthslistview = (ListView) findviewbyid(r.id.months_list); arrayadapter = new ArrayAdapter(this, android.r.layout.simple_list_item_1, monthsarray); monthslistview.setadapter(arrayadapter); va quyidagi natijaga erishamiz :

24 2.Custom Adapter bilan ishlash: Ushbu adapter oldin ko`rib chiqqan ListView dan farqli jihati ImageView va Textview larni birlashtirgan holatlarda bitta itemda chiqarishimiz mumkin. Masalan: <LinearLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:divider="#b5b5b5" android:dividerheight="1dp" </ListView> </LinearLayout> SampleActivity ni yaratib getview() metodini ishlatamiz, ya`ni: package vatsag.samples.weatherdisplay; import vatsag.samples.weatherdisplay.r;

25 import android.media.mediaplayer; import android.os.bundle; import android.app.activity; import android.content.intent; import android.graphics.drawable.drawable; import android.util.log; import android.view.menu; import android.view.view; import android.widget.button; import android.widget.imagebutton; import android.widget.imageview; import android.widget.textview; import android.widget.toast; public class SampleActivity extends Activity { String position = "1"; String city = ""; String weather = ""; String temperature = ""; String windspeed = ""; String iconfile = ""; ImageButton imgweathericon; TextView tvcity; TextView tvtemp; TextView tvwindspeed; TextView

26 public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.detailpage); try { imgweathericon = (ImageButton) findviewbyid(r.id.imagebuttonalpha); tvcity = (TextView) findviewbyid(r.id.textviewcity); tvtemp = (TextView) findviewbyid(r.id.textviewtemperature); tvwindspeed = (TextView) findviewbyid(r.id.textviewwindspeed); tvcondition = (TextView) findviewbyid(r.id.textviewcondition); Intent i = getintent(); this.position = i.getstringextra("position"); this.city = i.getstringextra("city"); this.weather= i.getstringextra("weather"); this.temperature = i.getstringextra("temperature"); this.windspeed = i.getstringextra("windspeed"); this.iconfile = i.getstringextra("icon"); String uri = "drawable/"+ "d" + iconfile; int imagebtnresource = getresources().getidentifier(uri, null, getpackagename()); Drawable dimgbutton = getresources().getdrawable(imagebtnresource); tvcity.settext(city); tvtemp.settext(temperature); tvwindspeed.settext(windspeed); tvcondition.settext(weather); imgweathericon.setimagedrawable(dimgbutton); catch (Exception ex) { Log.e("Error", "Loading exception");

27 @Override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.main, menu); return true; Vazifalar: Ushbu lobaratoriya mashg`ulotida har bir talaba listview komponentasini ishlatib o`tishi kerak bo`ladi va ular ustida yaratish, o`zgartirish, o`chirish va o`qish kabi amallarni bajarib o`tishi kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish

28 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20 klient dasturini ko`rinishi Lobarotoriya mashg`uloti 5 Mavzu: Ma lumotlarni qurilmada saqlash. Ichki va tashqi xotiradan foydalanish. Ishdan maqsad: Ma`lumotlarni xotirada saqlashni o`rganish.mobile dasturlarni ichki va tashqi xotiralarida ishlashini kuzatish. Nazariy qism: Android ma`lumotlaringizni saqlash uchun sizga bir nechta xotira turlarini yaratib beradi. Ular bo`lishi mumkin:

29 1. Shared Preferences Kalit so`zlar yordamida xotirada saqlash 2. Internal Storage Qurilma xotirasida saqlash 3. External Storage Umumiy ichki xotirada saqlash 4. SQLite Databases Ma`lumotlar bazasinda strukturalab saqlash Ichki xotira ma`lumotlarni qurilma xotirasiga yozish imkonini yaratib beradi. Xotiralar dastur o`rnatilinganda system fayllar qatoriga yozib qo`yiladi va u o`chirilib tashlanganda ham ma`lumotlar bazasi birga o`chib ketadi. FileOutputStream fout = openfileoutput("file name here",mode_world_readable); openfileoutput() metodi yordamida ma`lumotlarni xotiraga yozishimiz mumkin. Fayldan o`qib olish openfileinput() metodi yordamida amalga oshirishingiz mumkin: FileInputStream fin = openfileinput(file); int c; String temp=""; while( (c = fin.read())!= -1){ temp = temp + Character.toString((char)c); fin.close(); Masalan: Ushbu misolda siz xotiraga yozish va o`qib olishni mobile platformalar uchun ko`rib chiqasiz. Bosqichlari Qisqacha ma`lumot 1 Siz Android Studio da yangi project yaratishingiz kerak 2 MainActivity.java asosiy ko`rinishni java faylini belgilab o`tishingiz kerak. 3 res/layout/activity_main ni shu katolog bo`yicha kiritishingiz mumkin.

30 4 Natijani ko`rishingiz uchun RUN qilishingiz lozim. MainActivity.java fayli package com.example.sairamkrishna.myapplication; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; import java.io.fileinputstream; import java.io.fileoutputstream; public class MainActivity extends Activity { Button b1,b2; TextView tv; EditText ed1; String data; private String file = protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); b1=(button)findviewbyid(r.id.button); b2=(button)findviewbyid(r.id.button2); ed1=(edittext)findviewbyid(r.id.edittext); tv=(textview)findviewbyid(r.id.textview2); b1.setonclicklistener(new View.OnClickListener() {

31 @Override public void onclick(view v) { data=ed1.gettext().tostring(); try { FileOutputStream fout = openfileoutput(file,mode_world_readable); fout.write(data.getbytes()); fout.close(); Toast.makeText(getBaseContext(),"file saved",toast.length_short).show(); catch (Exception e) { // TODO Auto-generated catch block e.printstacktrace(); ); b2.setonclicklistener(new View.OnClickListener() public void onclick(view v) { try{ FileInputStream fin = openfileinput(file); int c; String temp=""; while( (c = fin.read())!= -1){ temp = temp + Character.toString((char)c); tv.settext(temp); Toast.makeText(getBaseContext(),"file read",toast.length_short).show(); catch(exception e){ );

32 @Override public boolean oncreateoptionsmenu(menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getmenuinflater().inflate(r.menu.menu_main, menu); return public boolean onoptionsitemselected(menuitem item) { int id = item.getitemid(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; return super.onoptionsitemselected(item); res/layout/activity_main.xml fayli <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity"> <TextView android:text="internal storage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="35dp" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" /> <TextView android:layout_width="wrap_content"

33 android:layout_height="wrap_content" android:text="tutorials point" android:layout_centerhorizontal="true" android:textcolor="#ff7aff24" android:textsize="35dp" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="save" android:layout_alignparentbottom="true" /> <EditText android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="enter Text" android:focusable="true" android:textcolorhighlight="#ff7eff15" android:textcolorhint="#ffff25e6" android:layout_margintop="42dp" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content"

34 android:layout_centerhorizontal="true" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="load" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="read" android:textcolor="#ff5bff1f" android:textsize="25dp" /> </RelativeLayout> res/values/string.xml fayli <resources> <string name="app_name">my Application</string> <string name="hello_world">hello world!</string> <string name="action_settings">settings</string> </resources> AndroidManifest.xml fayli <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.sairamkrishna.myapplication" > <application android:allowbackup="true"

35 > <activity android:name=".mainactivity" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest> Run tugmasi bosganimizda bizga quyidagicha oyna ochib beradi : Files/mydate.txt fileda (LogCat.e da) saqlanadi, biz yaratgan loyihaning ma`lumtlari. Vazifa: Ushbu lobarotoriyada har bir talaba o`zining shaxsiy dasturida tashqi va ichki xotirani ishlatib, ma`lumotlarini saqlab qo`yishi kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish

36 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20 klient dasturini ko`rinishi Lobarotoriya mashg`uloti 6 Mavzu: SQLite MBBT bilan ishlash. Ishdan maqsad: Ma`lumotlar bazasini ishlash prinspini o`rganishi, haqiqiy proyektlarda ma`lumotlar bazasini tutgan o`rni, grfik ko`rinishda ularni boshqarish va CRUD tizimini o`rganish. Nazariy qism: Android da SQLite Database da ishlash. CRUD tizimi. BIzlar oldingi lobarotoriya mashg`ulotida xotira turlari bilan tanishib chiqqan edik, masalan SharePreferences yoki ichki va tashqi xotiralarni. Android SDK da sqlite uchun maxsus

37 kutubxonalar mavjud bo`lib, android.database.sqlite package yordamida chaqirilib olinadi. Bizlar ushbu lobaratoriya masg`ulotimizda SQLite da CRUD tizimini o`rganib chiqamiz. Ma`lumotlar bazasini sqlite da yaratish: Bazadannix SQLiteOpenHelper metodi yordamida java fayliga import qlinib olinadi. public class PostDatabase extends SQLiteOpenHelper { private static final String TAG = "PostDatabase"; // Database Specific Details // If you change the database schema, you must increment the database version. private static final int DB_VERSION = 1; // DB Name, same is used to name the sqlite DB file private static final String DB_NAME = "test_db"; // `posts` table details public static final String TABLE_POSTS = "posts"; public static final String ID = "id"; public static final String COL_TITLE = "title"; public static final String COL_CONTENT = "content"; private static final String CREATE_TABLE_POSTS = "CREATE TABLE " + TABLE_POSTS + " (" + ID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + COL_TITLE + " TEXT NOT NULL, " + COL_CONTENT + " TEXT NOT NULL);"; public PostDatabase(Context context) { super(context, DB_NAME, null, public void oncreate(sqlitedatabase db) { // Called when the database is created for the // first time. This is where the creation of // tables and the initial population of the tables should happen.

38 public void onupgrade(sqlitedatabase db, int oldversion, int newversion) { // Called when the database needs to be upgraded. // The implementation should use this method to // drop tables, add tables, or do anything else // it needs to upgrade to the new schema version. Log.w(TAG, "Upgrading database. Existing contents will be lost. [" + oldversion + "] -> [" + newversion + "]"); db.execsql("drop TABLE IF EXISTS " + TABLE_POSTS); // Create after dropping oncreate(db); Biz yaratgan sinfda PostDatabase ni tanishtirb o`tishimiz kerak. public final class DatabaseContract { public static abstract class Post implements BaseColumns { public static final String TABLE_NAME = "posts"; public static final String COL_TITLE = "title"; public static final String COL_CONTENT = "content"; SQLite da bazadan o`qish va yozish: getreadabledatabase() yoki getwritabledatabase() metodlari yordamida ma`lumotlar bazasiga murojat qilishimiz mumkin. PostDatabase DB = new PostDatabase(MainActivity.this); SQLiteDatabase sqldb = DB.getWritableDatabase(); // Execute queries... sqldb.close(); getwritabeldatabase() metodini SQLite boyektlari uchun qaytaradi. Bunda biz databasega o`qish va yozish imkoniyatini yaratadi. Database yaratamiz

39 ContentValues values = new ContentValues(); values.put(postdatabase.col_title, "Test Title"); values.put(postdatabase.col_content, "Test Content"); sqldb.insert(postdatabase.table_posts, null, values); insert() metodi yordamida ma`lumot kiritiladi. ContentValues values = new ContentValues(); values.put(postdatabase.col_title, "Test Title"); values.put(postdatabase.col_content, "Test Content"); sqldb.insert(postdatabase.table_posts, null, values); Cursor cursor = sqldb.rawquery("select * FROM posts WHERE id =?", new String[]{ "1" ); if (cursor!= null && cursor.movetofirst()) { String title = cursor.getstring(cursor.getcolumnindex(postdatabase.col_title)); String content = cursor.getstring(cursor.getcolumnindex(postdatabase.col_content)); Log.d(TAG, "Title: " + title + " Content: " + content); cursor.close(); values = new ContentValues(); values.put(postdatabase.col_title, "Second Title"); values.put(postdatabase.col_content, "Second Content"); sqldb.insert(postdatabase.table_posts, null, values); // public Cursor query (String table, String[] columns, String selection, String[] selectionargs, String groupby, String having, String orderby, String limit) cursor = sqldb.query(postdatabase.table_posts,, new String[] { PostDatabase.ID, PostDatabase.COL_TITLE, PostDatabase.COL_CONTENT null, null, null, null, null); if (cursor!= null) { int idindex = cursor.getcolumnindex(postdatabase.id); int titleindex = cursor.getcolumnindex(postdatabase.col_title); int contentindex = cursor.getcolumnindex(postdatabase.col_content); cursor.movetofirst(); while (!cursor.isafterlast()) {

40 int id = cursor.getint(idindex); String title = cursor.getstring(titleindex); String content = cursor.getstring(contentindex); // Dumps (2 rows): // ID: 1 Title: Test Title Content: Test Content // ID: 2 Title: Second Title Content: Second Content Log.d(TAG, "ID: " + id + " Title: " + title + " Content: " + content); cursor.movetonext(); Ma`lumotlarni o`zgartirish (UPDATE) Qaysi joyini o`zgartirmoqchi bo`lsak o`sh yerni tanlab olishimiz kerak: ContentValues values = new ContentValues(); values.put(postdatabase.col_title, "Second title changed"); // Which row to update, based on the ID String whereclause = PostDatabase.ID + " LIKE?"; String[] whereargs = { "2" ; int affectedrows = sqldb.update( // Dumps 1 ); PostDatabase.TABLE_POSTS, values, whereclause, whereargs Log.d(TAG, String.valueOf(affectedRows)); Ma`lumotlarni o`chirish (DELETE) Qaysi joyini o`chirmoqchi bo`lsak o`sh yerni tanlab olishimiz kerak: String whereclause = PostDatabase.ID + " =?"; // Specify arguments in placeholder order. String[] whereargs = { "1" ; // Issue SQL statement. sqldb.delete(postdatabase.table_posts, whereclause, whereargs);

41 SQLiteQueryBuilder SQLiteQueryBuilder querybuilder = new SQLiteQueryBuilder(); querybuilder.settables(postdatabase.table_posts); querybuilder.appendwhere("id = 1"); // Dumps "SELECT * FROM posts WHERE (id = 1)" Log.d(TAG, querybuilder.buildquery(null, null, null, null, null, null)); // querybuilder.query(db.getreadabledatabase(), projection, selection, selectionargs, null, null, sortorder) Here s how you could build a JOIN (between posts and comments table): querybuilder.settables( ); PostDatabase.TABLE_POSTS + " INNER JOIN " + PostDatabase.TABLE_COMMENTS + " ON " + PostDatabase.ID + " = " + (PostDatabase.TABLE_COMMENTS + "." + PostDatabase.COMMENT_POST_ID) // querybuilder.query(...) Vazifa: Ushbu lobaratoriya mashg`ulotida har bir talaba o`ziga berkitilgan topshiriqni ma`lumotlar bazasida ifodalashi kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish

42 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20. mail klient dasturini ko`rinishi Lobarotoriya mashg`uloti 7 Mavzu: JSON ga asoslangan Web xizmatlar bilan integratsiya. Ishdan maqsad: JSON ga integratsiyalangan web xizmatlar. JSON ga integratsiyalangan web xiazmatlarni o`rganish, JSON orqali parse qilish, web texnologiyalari orqali JSON da bog`lanish Nazariy qism: JSON bu JavaScript Object Notation hozirgi kunda keng qo`llaniladigan formatlardan biri hisoblanadi. JSON orqali har il turdagi ma`lumotlarni o`qib olish mumkin. Quyidagi misolda JSON orqali ob-havoni bilishni ko`rib chiqamiz. { "sys": { "country":"gb",

43 "sunrise": , "sunset": , "weather":[ { "id":711, "main":"smoke", "description":"smoke", "icon":"50n" ], "main": { "temp":304.15, "pressure":1009, JSON - Elementlari JSONda ko`pgina komponenetalar orqali biror bir jadvaldan ma`lumotlarni oqib olish mumkin. Komponentalar & Qisqacha ma`lumotlar 1 Array([) JSON faylda, belgi orqali ([) yuklab olinadi. 2 Objects({) JSON faylda, belgi orqali ([) ma`lumotlar yuklab olinadi. 3 Key JSON kalit so`zlar orqali o`qib oladigan ma`lumotlarni ushlab oladi JSON Parse JSON da obyektlarni parse qilishimiz uchun json komponentalarini to`g`ri tanlay olishimiz kerak. String in; JSONObject reader = new JSONObject(in);

44 JSON obyektlari har xil kalit so`zlarga ega bo`lishi mumkin. JSONObject sys = reader.getjsonobject("sys"); country = sys.getstring("country"); JSONObject main = reader.getjsonobject("main"); temperature = main.getstring("temp"); getjsonobject metodi JSON obyektlarini qaytaradi. getstring esa maxsus kalit soz hisoblanadi. Masalan: Steps Description 1 Siz Android Studio da yangi project yaratishingiz kerak. 2 src/mainactivity.java fayli. 3 res/layout/activity_main fayli 4 res/values/string.xml satrli o`zgaruvchilar MainActivity.java package com.androidstudio.json; import android.app.activity; import android.os.strictmode; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.widget.button; import android.widget.textview; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.statusline; import org.apache.http.client.clientprotocolexception;

45 import org.apache.http.client.httpclient; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; public class MainActivity extends Activity { public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); TextView output = (TextView) findviewbyid(r.id.textview1); String strjson=" { \"Employee\" :[ { \"id\":\"01\", \"name\":\"gopal Varma\", \"salary\":\"500000\", { \"id\":\"02\", \"name\":\"sairamkrishna\", \"salary\":\"500000\", { \"id\":\"03\", \"name\":\"sathish kallakuri\", \"salary\":\"600000\"

46 ] "; String data = ""; try { JSONObject jsonrootobject = new JSONObject(strJson); //Get the instance of JSONArray that contains JSONObjects JSONArray jsonarray = jsonrootobject.optjsonarray("employee"); //Iterate the jsonarray and print the info of JSONObjects for(int i=0; i < jsonarray.length(); i++){ JSONObject jsonobject = jsonarray.getjsonobject(i); int id = Integer.parseInt(jsonObject.optString("id").toString()); String name = jsonobject.optstring("name").tostring(); float salary = Float.parseFloat(jsonObject.optString("salary").toString()); data += "Node"+i+" : \n id= "+ id +" \n Name= "+ name +" \n Salary= "+ salary +" \n "; output.settext(data); catch (JSONException e) {e.printstacktrace(); activity_main.xml <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="json example" android:layout_alignparenttop="true"

47 android:layout_centerhorizontal="true" android:textsize="30dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="tutorials Point" android:layout_centerhorizontal="true" android:textsize="35dp" android:textcolor="#ff16ff01" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="new Text" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_alignparentright="true" android:layout_alignparentend="true" /> </RelativeLayout> AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.sairamkrishna.myapplication" > <uses-permission android:name="android.permission.internet"/> <application android:allowbackup="true" > <activity

48 android:name=".mainactivity" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest> JSON komponentalari yordamida ma`lumotlarni o`qib olib, quyidagi oyna hosil bo`ldi. Vazifa: Ushbu loboratoriya mashg`ulotida JSON formatidan foydalanib obyektlarni parse qilishni o`rganishlari, o`zlarining loyihalarida qatnashtirishlari kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish 3. Talabalar ma`lumotlar bazasini yaratish 4.Talabalarni bazada saqlashni boshqarish 5.Ixtiyoriy bir tashkilotni invertirlashni ko`rsatish 6. Sotilmagan biletlarni ro`yhatini shakllantirish 7. On-line lug`atni shkllantirish 8. Avtotest dasturini.xml ni yaratish 9. Mehmonhonalarda registratsiya qilishni ko`rinishini chizish 10 Shifoxonalarda registratsiya qilishni ko`rinishini chizish 11 Bemorlarni tarixini chiqarishni dizaynini yaratsih

49 12. On-line mobile messanger 13 Biror bir fan to`g`risinda ma`lumot beruvchi ko`rinishni yartish 14. Avtomob stansiyalarini ro`yhatga oluvchi ko`rinish 15 Xizmatchilarni ro`yhatga olish 16. To`lovlarni to`lashni boshqarishni ko`rinishini yasash 17.Tu`gilgan kunlarni ro`yhatga olish dasturini ko`rinishini yasash 18 Internet magazinni ko`rinishi 19 Komponiya ogohlantirishlari haqida ma`lumot beruvchi ko`rinish 20 klient dasturini ko`rinishi Lobarotoriya mashg`uloti 8 Mavzu: Geografik joylashuv o rnini aniqlash. Google maps bilan integratsiya. Ishdan maqsad: Yangi texnologiyalarni o`rganish, zamonaviy Google Map texnologiyasida joylashuv o`rninini aniqlash. Nazariy qism: Joylashuv o`rningizni google map orqali aniqlashda uzunlik va kenglik koordinatalarini aniq bilib olish kerak. Masalan, siz o`zingiz qaysi manzilda ekanligingizni bilib olmoqchi bo`lsangiz, qaysi ko`chada yoki qaysi nuqtada ekanligingizni unda siz ushbu parametrlarni aniqiqlab olishingiz kerak bo`ladi. getfromlocation() metodi orqali siz grafik ko`rinishda joylashuv o`rningizni aniqlab olishingiz mumkin, Geocoder tizimi deb ham aytish mumkin. Bu tizimni ishlash prinspi kenglik va uzunlikni aniqlab joylashuv manzilni ko`rsatadi. GoogleMap googlemap; googlemap = ((MapFragment) getfragmentmanager().findfragmentbyid(r.id.map)).getmap(); Google Map activity_main.xml <fragment android:name="com.google.android.gms.maps.mapfragment" android:layout_width="match_parent" android:layout_height="match_parent" /> Google Map AndroidManifest.xml <!--Permissions--> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-permission android:name="android.permission.write_external_storage" /> <!--Google MAP API key-->

50 <meta-data android:name="com.google.android.maps.v2.api_key" android:value="aizasydkymebxneifwy5jruejv6zitpmr2mvyq0" /> Google Mapni sozlash: Siz Google Map ni osongina sozlab olishingiz mumkin. addmarker() metodi orqali. final LatLng tuiturgench = new LatLng(21, 57); Marker TP = googlemap.addmarker(new MarkerOptions().position(tuiturgench).title("TATU Urganch filiali")); Siz shuningdek aniqlab olishi kerak deb bilgan karta turlarini ham o`zgartirishingiz mumkin. Hozirda to`rtta karta turi mavjud va ularning har biri har xil ko`rinigshda ko`rsatadi. googlemap.setmaptype(googlemap.map_type_normal); googlemap.setmaptype(googlemap.map_type_hybrid); googlemap.setmaptype(googlemap.map_type_satellite); googlemap.setmaptype(googlemap.map_type_terrain); setzoomcontrolsenabled() metodi orali masshtabni sozlashingiz mumkin: googlemap.getuisettings().setzoomgesturesenabled(true); Metodlar & qisqacha ma`lumot 1 addcircle() Ushbu metod kartada biror bir yuzani aniq ko`rsatib turadi 2 addpolygon() Ushbu metod kartada ko`pqirrali maydonni ko`rsatib turadi 3 addtileoverlay() Ushbu metod kartada plitkalarni ko`rsatib turadi 4 animatecamera() Ushbu metod kartada animatsiyali grafik ko`rinishlarini ko`rsatib turadi 5 clear() Ushbu metod kartada tozalash vazifasini bajaradi. 6 getmylocation() Ushbu metod hozirda siz qaysi kenglikda turganligingizni aniqlab beradi.

51 7 movecamera() Kameradagi o`zgarishlarni googlemap orqali qaytaradi 8 settrafficenabled() Ushbu metod trafiklarni sozlash imkoniyatini yaratdi 9 snapshot(googlemap.snapshotreadycallback callback) Ushbu metod kartada nusxa olish vazifasini bajaradi. 10 stopanimation() Ushbu metod animatsiyali jarayonlarni to`taib qo`yish vazifasini bajaradi. Masalan: Qisqacha ma`lumot 1 Sizning dasturingiz uchun googlemap ni integratsiyalab olishingiz kerak 2 Android Studio da yangi project yaratishingiz kerak bo`ladi, google Map API ni SDK Manager orqali yuklab olib yaratishingiz kerak. 3 MainActivity.java faylingiz 4 activity_main.xml grafik ko`rinishingiz 5 AndroidManifest.xml faylini sozlashingiz kerak. Google Play Service SDK ni yuklab olish: Kerakli kutubonalarni yuklab olishingiz kerak bo`ladi va u quyidagicha amalga oshiriladi:

52 API dan kalit olish: Bu jarayon ikki bosqich orqali amalga oshiriladi. Birinchi bosqich GoogleMap dan SHA1 kalitini olishingiz kerak. Bunda siz JRE ni ko`rsatib o`tishingiz kerak, ya`ni dasturiy ta`minotingiz orqali ma`lumot berishingiz kerak bo`ladi. Shunda sizga xaritani ishlatishingiz uchun API dan kalit olishingiz mimkin. keytool -list -v -alias androiddebugkey -keystore %%Your path%% -storepass android -keypass android Olgan kalitingizni % belgis turgan joyga joylashtirishingiz kerak. SHA1 kalitini nisxalab oling, Google ga kirib yangi loyiha yarating va API Google Maps v2 Android xizmatlarini yoqib qo`yishingiz kerak. Kalit sozni kiritib nuqta verguldan keyin dasturni nomini belgilashingiz kerak. AndroidManifest.xml ni sozlash: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.googlemaps" android:versioncode="1"

53 android:versionname="1.0" > <uses-permission android:name="com.example.googlemaps.permission.maps_receive" /> <uses-sdk android:minsdkversion="12" android:targetsdkversion="17" /> <permission android:name="com.example.googlemaps.permission.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="com.google.android.providers. gsf.permission. READ_GSERVICES" /> <uses-permission android:name="android.permission. WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission. ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-feature android:glesversion="0x " android:required="true" /> <application android:allowbackup="true" > <activity android:name="com.example.googlemaps.mainactivity" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" />

54 </intent-filter> </activity> <meta-data android:name="com.google.android.maps.v2.api_key" android:value="aizasydkymebxneifwy5jruejv6zitpmr2mvyq0" /> </application> </manifest> MainActivity.java package com.example.googlemaps; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.marker; import com.google.android.gms.maps.model.markeroptions; import android.os.bundle; import android.app.activity; import android.widget.toast; public class MainActivity extends Activity { static final LatLng TutorialsPoint = new LatLng(21, 57); private GoogleMap protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); try { if (googlemap == null) { googlemap = ((MapFragment) getfragmentmanager(). findfragmentbyid(r.id.map)).getmap(); googlemap.setmaptype(googlemap.map_type_hybrid); Marker TP = googlemap.addmarker(new MarkerOptions(). position(tutorialspoint).title("tutorialspoint"));

55 catch (Exception e) { e.printstacktrace(); activity_main.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" android:layout_width="fill_parent" android:layout_height="fill_parent" > <fragment android:name="com.google.android.gms.maps.mapfragment" android:layout_width="match_parent" android:layout_height="match_parent"/> </RelativeLayout> va quyidagi natijaga erishamiz: Vazifa: Ushbu lobarotoriyada har bir talaba zamonaviy GoogleMap xizmatlarini yaxshi blishlari kerak.mobile dasturlarda ko`pgina funksiyalar ushbu tizim orqali amalga oshiriladi. Har kim o`ziga berkitilgan topshiriqlarda GoogleMap xizmatini ham ishlatib o`tishi kerak. Variyantlar : 1.Talabalarni registratsiya qilish formasini yaratish 2.Sport chempianatlarini ro`yhatini ko`rishni tuzish

Android - JSON Parser Tutorial

Android - JSON Parser Tutorial Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file

More information

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

MAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MAD ASSIGNMENT NO 3 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MainActivity.java File package com.example.tutorialspoint; import android.manifest;

More information

Android - Widgets Tutorial

Android - Widgets Tutorial Android - Widgets Tutorial A widget is a small gadget or control of your android application placed on the home screen. Widgets can be very handy as they allow you to put your favourite applications on

More information

Create Parent Activity and pass its information to Child Activity using Intents.

Create Parent Activity and pass its information to Child Activity using Intents. Create Parent Activity and pass its information to Child Activity using Intents. /* MainActivity.java */ package com.example.first; import android.os.bundle; import android.app.activity; import android.view.menu;

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Tip: Switching UIs THE PROBLEM How to switch from one UI to another Each UI is associated with a distinct class that controls it Solution shown: two UIs,

More information

Statistics http://www.statista.com/topics/840/smartphones/ http://www.statista.com/topics/876/android/ http://www.statista.com/statistics/271774/share-of-android-platforms-on-mobile-devices-with-android-os/

More information

Fragment Example Create the following files and test the application on emulator or device.

Fragment Example Create the following files and test the application on emulator or device. Fragment Example Create the following files and test the application on emulator or device. File: AndroidManifest.xml

More information

Tabel mysql. Kode di PHP. Config.php. Service.php

Tabel mysql. Kode di PHP. Config.php. Service.php Tabel mysql Kode di PHP Config.php Service.php Layout Kode di Main Activity package com.example.mini.webandroid; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity;

More information

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 2 Workshop 1. Compare different layout by using Change Layout button (Page 1 5) Relative Layout Linear Layout (Horizontal) Linear Layout (Vertical) Frame Layout 2. Revision on basic programming skill - control

More information

Database Development In Android Applications

Database Development In Android Applications ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Database Development In Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran

More information

Our First Android Application

Our First Android Application Mobile Application Development Lecture 04 Imran Ihsan Our First Android Application Even though the HelloWorld program is trivial in introduces a wealth of new ideas the framework, activities, manifest,

More information

Vienos veiklos būsena. Theory

Vienos veiklos būsena. Theory Vienos veiklos būsena Theory While application is running, we create new Activities and close old ones, hide the application and open it again and so on, and Activity can process all these events. It is

More information

MAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.

MAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MAD ASSIGNMENT NO 2 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. Android Widgets There are given a lot of android widgets with simplified

More information

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)

Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) In this exercise, we will create a simple Android application that uses IBM Bluemix Cloudant NoSQL DB. The application

More information

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation

1. Location Services. 1.1 GPS Location. 1. Create the Android application with the following attributes. Application Name: MyLocation 1. Location Services 1.1 GPS Location 1. Create the Android application with the following attributes. Application Name: MyLocation Project Name: Package Name: MyLocation com.example.mylocation 2. Put

More information

Android Application Development. By : Shibaji Debnath

Android Application Development. By : Shibaji Debnath Android Application Development By : Shibaji Debnath About Me I have over 10 years experience in IT Industry. I have started my career as Java Software Developer. I worked in various multinational company.

More information

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)

PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) Network Connection Web Service K Candra Brata andra.course@gmail.com Mobille App Lab 2015-2016 Network Connection http://developer.android.com/training/basics/network-ops/connecting.html

More information

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering

Getting Started. Dr. Miguel A. Labrador Department of Computer Science & Engineering Getting Started Dr. Miguel A. Labrador Department of Computer Science & Engineering labrador@csee.usf.edu http://www.csee.usf.edu/~labrador 1 Goals Setting up your development environment Android Framework

More information

Android Layout Types

Android Layout Types Android Layout Types Android Linear Layout Android LinearLayout is a view group that aligns all children in either vertically or horizontally. android:divider - This is drawable to use as a vertical divider

More information

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.

CSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server. CSE 660 Lab 7 Submitted by: Arumugam Thendramil Pavai 1)Simple Remote Calculator Server is created using ServerSocket class of java Server.java import java.io.ioexception; import java.net.serversocket;

More information

Mobile Software Development for Android - I397

Mobile Software Development for Android - I397 1 Mobile Software Development for Android - I397 IT COLLEGE, ANDRES KÄVER, 2015-2016 EMAIL: AKAVER@ITCOLLEGE.EE WEB: HTTP://ENOS.ITCOLLEGE.EE/~AKAVER/2015-2016/DISTANCE/ANDROID SKYPE: AKAVER Timetable

More information

Android Programs Day 5

Android Programs Day 5 Android Programs Day 5 //Android Program to demonstrate the working of Options Menu. 1. Create a New Project. 2. Write the necessary codes in the MainActivity.java to create OptionMenu. 3. Add the oncreateoptionsmenu()

More information

Introduction to Android Development

Introduction to Android Development Introduction to Android Development What is Android? Android is the customizable, easy to use operating system that powers more than a billion devices across the globe - from phones and tablets to watches,

More information

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015

CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 Comment and Evaluation: This lab introduces us about Android SDK and how to write a program for Android platform. The calculator is pretty easy, everything

More information

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology

Android App Development. Mr. Michaud ICE Programs Georgia Institute of Technology Android App Development Mr. Michaud ICE Programs Georgia Institute of Technology Android Operating System Created by Android, Inc. Bought by Google in 2005. First Android Device released in 2008 Based

More information

TextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.

TextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control. A TextView displays text to the user. TextView Attributes TextView Control android:id - This is the ID which uniquely identifies the control. android:capitalize - If set, specifies that this TextView has

More information

<uses-permission android:name="android.permission.internet"/>

<uses-permission android:name=android.permission.internet/> Chapter 11 Playing Video 11.1 Introduction We have discussed how to play audio in Chapter 9 using the class MediaPlayer. This class can also play video clips. In fact, the Android multimedia framework

More information

Software Practice 3 Before we start Today s lecture Today s Task Team organization

Software Practice 3 Before we start Today s lecture Today s Task Team organization 1 Software Practice 3 Before we start Today s lecture Today s Task Team organization Prof. Hwansoo Han T.A. Jeonghwan Park 43 2 Lecture Schedule Spring 2017 (Monday) This schedule can be changed M A R

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Saving State THE PROBLEM How to save the state (of a UI, for instance) so that it survives even when the application is closed/killed The state should

More information

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.

Mobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator. Simple Android Application for Native Calculator Aim: To develop a Simple Android Application for Native Calculator. Procedure: Creating a New project: Open Android Stdio and then click on File -> New

More information

Android UI Development

Android UI Development Android UI Development Android UI Studio Widget Layout Android UI 1 Building Applications A typical application will include: Activities - MainActivity as your entry point - Possibly other activities (corresponding

More information

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

Lampiran Program : Res - Layout Activity_main.xml

More information

An Android Studio SQLite Database Tutorial

An Android Studio SQLite Database Tutorial An Android Studio SQLite Database Tutorial Previous Table of Contents Next An Android Studio TableLayout and TableRow Tutorial Understanding Android Content Providers in Android Studio Purchase the fully

More information

Fragments. Lecture 11

Fragments. Lecture 11 Fragments Lecture 11 Situational layouts Your app can use different layouts in different situations Different device type (tablet vs. phone vs. watch) Different screen size Different orientation (portrait

More information

COMP61242: Task /04/18

COMP61242: Task /04/18 COMP61242: Task 2 1 16/04/18 1. Introduction University of Manchester School of Computer Science COMP61242: Mobile Communications Semester 2: 2017-18 Laboratory Task 2 Messaging with Android Smartphones

More information

Intents. Your first app assignment

Intents. Your first app assignment Intents Your first app assignment We will make this. Decidedly lackluster. Java Code Java Code XML XML Preview XML Java Code Java Code XML Buttons that work

More information

Basic GUI elements - exercises

Basic GUI elements - exercises Basic GUI elements - exercises https://developer.android.com/studio/index.html LIVE DEMO Please create a simple application, which will be used to calculate the area of basic geometric figures. To add

More information

EMBEDDED SYSTEMS PROGRAMMING Android Services

EMBEDDED SYSTEMS PROGRAMMING Android Services EMBEDDED SYSTEMS PROGRAMMING 2016-17 Android Services APP COMPONENTS Activity: a single screen with a user interface Broadcast receiver: responds to system-wide broadcast events. No user interface Service:

More information

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches

EMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI Specification: Approaches UIS: APPROACHES Programmatic approach: UI elements are created inside the application code Declarative approach: UI elements are listed

More information

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop

Android Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop Workshop 1. Create an Option Menu, and convert it into Action Bar (Page 1 8) Create an simple Option Menu Convert Option Menu into Action Bar Create Event Listener for Menu and Action Bar Add System Icon

More information

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology

More information

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation

EMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Managing Screen Orientation ORIENTATIONS Portrait Landscape Reverse portrait Reverse landscape ON REVERSE PORTRAIT Android: all four orientations are

More information

Diving into Android. By Jeroen Tietema. Jeroen Tietema,

Diving into Android. By Jeroen Tietema. Jeroen Tietema, Diving into Android By Jeroen Tietema Jeroen Tietema, 2015 1 Requirements 4 Android SDK 1 4 Android Studio (or your IDE / editor of choice) 4 Emulator (Genymotion) or a real device. 1 See https://developer.android.com

More information

Android Application Development

Android Application Development Android Application Development Octav Chipara What is Android A free, open source mobile platform A Linux-based, multiprocess, multithreaded OS Android is not a device or a product It s not even limited

More information

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application.

IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application. Learning Unit Exam Project IPN-ESCOM Application Development for Mobile Devices. Extraordinary. A Web service, invoking the SOAP protocol, in an Android application. The delivery of this project is essential

More information

Android Navigation Drawer for Sliding Menu / Sidebar

Android Navigation Drawer for Sliding Menu / Sidebar Android Navigation Drawer for Sliding Menu / Sidebar by Kapil - Tuesday, December 15, 2015 http://www.androidtutorialpoint.com/material-design/android-navigation-drawer-for-sliding-menusidebar/ YouTube

More information

ANDROID PROGRAMS DAY 3

ANDROID PROGRAMS DAY 3 ANDROID PROGRAMS DAY 3 //Android project to navigate from first page to second page using Intent Step 1: Create a new project Step 2: Enter necessary details while creating project. Step 3: Drag and drop

More information

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna

Programming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Programming with Android: Introduction Layouts Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Views: outline Main difference between a Drawable and

More information

Tutorial: Setup for Android Development

Tutorial: Setup for Android Development Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Autumn 2017 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu

More information

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence

Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza. Data persistence Eng. Jaffer M. El-Agha Android Programing Discussion Islamic University of Gaza Data persistence Shared preferences A method to store primitive data in android as key-value pairs, these saved data will

More information

Time Picker trong Android

Time Picker trong Android Time Picker trong Android Time Picker trong Android cho phép bạn lựa chọn thời gian của ngày trong chế độ hoặc 24 h hoặc AM/PM. Thời gian bao gồm các định dạng hour, minute, và clock. Android cung cấp

More information

EMBEDDED SYSTEMS PROGRAMMING Application Basics

EMBEDDED SYSTEMS PROGRAMMING Application Basics EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Basics APPLICATIONS Application components (e.g., UI elements) are objects instantiated from the platform s frameworks Applications are event driven ( there

More information

LifeStreet Media Android Publisher SDK Integration Guide

LifeStreet Media Android Publisher SDK Integration Guide LifeStreet Media Android Publisher SDK Integration Guide Version 1.12.0 Copyright 2015 Lifestreet Corporation Contents Introduction... 3 Downloading the SDK... 3 Choose type of SDK... 3 Adding the LSM

More information

UNDERSTANDING ACTIVITIES

UNDERSTANDING ACTIVITIES Activities Activity is a window that contains the user interface of your application. An Android activity is both a unit of user interaction - typically filling the whole screen of an Android mobile device

More information

Data Persistence. Chapter 10

Data Persistence. Chapter 10 Chapter 10 Data Persistence When applications create or capture data from user inputs, those data will only be available during the lifetime of the application. You only have access to that data as long

More information

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH

Android Basics. - Bhaumik Shukla Android Application STEALTH FLASH Android Basics - Bhaumik Shukla Android Application Developer @ STEALTH FLASH Introduction to Android Android is a software stack for mobile devices that includes an operating system, middleware and key

More information

// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer

// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer // MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer package com.noahspenser.seniordesign; import android.os.parcel; import android.os.parcelable; import android.support.v7.app.appcompatactivity;

More information

ELET4133: Embedded Systems. Topic 15 Sensors

ELET4133: Embedded Systems. Topic 15 Sensors ELET4133: Embedded Systems Topic 15 Sensors Agenda What is a sensor? Different types of sensors Detecting sensors Example application of the accelerometer 2 What is a sensor? Piece of hardware that collects

More information

Embedded Systems Programming - PA8001

Embedded Systems Programming - PA8001 Embedded Systems Programming - PA8001 http://goo.gl/ydeczu Lecture 8 Mohammad Mousavi m.r.mousavi@hh.se Center for Research on Embedded Systems School of Information Science, Computer and Electrical Engineering

More information

Workshop. 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking

Workshop. 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking Workshop 1. Create a simple Intent (Page 1 2) Launch a Camera for Photo Taking 2. Create Intent with Parsing Data (Page 3 8) Making Phone Call and Dial Access Web Content Playing YouTube Video 3. Create

More information

Mobila applikationer och trådlösa nät, HI1033, HT2013

Mobila applikationer och trådlösa nät, HI1033, HT2013 Mobila applikationer och trådlösa nät, HI1033, HT2013 Today: - User Interface basics - View components - Event driven applications and callbacks - Menu and Context Menu - ListView and Adapters - Android

More information

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices.

Group B: Assignment No 8. Title of Assignment: To verify the operating system name and version of Mobile devices. Group B: Assignment No 8 Regularity (2) Performance(5) Oral(3) Total (10) Dated Sign Title of Assignment: To verify the operating system name and version of Mobile devices. Problem Definition: Write a

More information

Real-Time Embedded Systems

Real-Time Embedded Systems Real-Time Embedded Systems DT8025, Fall 2016 http://goo.gl/azfc9l Lecture 8 Masoumeh Taromirad m.taromirad@hh.se Center for Research on Embedded Systems School of Information Technology 1 / 51 Smart phones

More information

Android Programming วรเศรษฐ ส วรรณ ก.

Android Programming วรเศรษฐ ส วรรณ ก. Android Programming วรเศรษฐ ส วรรณ ก uuriter@yahoo.com http://bit.ly/wannikacademy 1 Google Map API v2 2 Preparation SDK Manager Google Play Services AVD Google API >= 4.2.2 [http://bit.ly/1hedxwm] https://developers.google.com/maps/documentation/android/start

More information

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences

ITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Shared Preferences 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran Tanveer, ITU Experts

More information

Manifest.xml. Activity.java

Manifest.xml. Activity.java Dr.K.Somasundaram Ph.D Professor Department of Computer Science and Applications Gandhigram Rural Institute, Gandhigram, Tamil Nadu-624302, India ka.somasundaram@gmail.com Manifest.xml

More information

Computer Science E-76 Building Mobile Applications

Computer Science E-76 Building Mobile Applications Computer Science E-76 Building Mobile Applications Lecture 3: [Android] The SDK, Activities, and Views February 13, 2012 Dan Armendariz danallan@mit.edu 1 http://developer.android.com Android SDK and NDK

More information

TPCT s College of Engineering, Osmanabad. Laboratory Manual SDL-II. Mobile Application Development (Android) For. Third Year Students (CSE)

TPCT s College of Engineering, Osmanabad. Laboratory Manual SDL-II. Mobile Application Development (Android) For. Third Year Students (CSE) TPCT s College of Engineering, Osmanabad Laboratory Manual SDL-II Mobile Application Development (Android) For Third Year Students (CSE) Manual Prepared by Prof. Sujata A. Gaikwad Author COE, Osmanabad

More information

Produced by. Mobile Application Development. Eamonn de Leastar

Produced by. Mobile Application Development. Eamonn de Leastar Mobile Application Development Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie A First

More information

Android Basics. Android UI Architecture. Android UI 1

Android Basics. Android UI Architecture. Android UI 1 Android Basics Android UI Architecture Android UI 1 Android Design Constraints Limited resources like memory, processing, battery à Android stops your app when not in use Primarily touch interaction à

More information

An Overview of the Android Programming

An Overview of the Android Programming ID2212 Network Programming with Java Lecture 14 An Overview of the Android Programming Hooman Peiro Sajjad KTH/ICT/SCS HT 2016 References http://developer.android.com/training/index.html Developing Android

More information

Tutorial: Setup for Android Development

Tutorial: Setup for Android Development Tutorial: Setup for Android Development Adam C. Champion CSE 5236: Mobile Application Development Spring 2018 Based on material from C. Horstmann [1], J. Bloch [2], C. Collins et al. [4], M.L. Sichitiu

More information

O ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI

O ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI O ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI URGANCH FILIALI KOMPYUTER INJINIRINGI FAKULTETI DASTURIY

More information

Android SQLite Database Tutorial - CRUD Operations

Android SQLite Database Tutorial - CRUD Operations Android SQLite Database Tutorial - CRUD Operations by Kapil - Monday, March 21, 2016 http://www.androidtutorialpoint.com/storage/android-sqlite-database-tutorial/ YouTube Video Android SQLite Introduction

More information

Practical 1.ListView example

Practical 1.ListView example Practical 1.ListView example In this example, we show you how to display a list of fruit name via ListView. Android Layout file File : res/layout/list_fruit.xml

More information

1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS.

1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS. 1. Explain the architecture of an Android OS. 10M The following diagram shows the architecture of an Android OS. Android OS architecture is divided into 4 layers : Linux Kernel layer: 1. Linux Kernel layer

More information

MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING

MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING This document can be downloaded from www.chetanahegde.in with most recent updates. 1 MODULE 2: GETTING STARTED WITH ANDROID PROGRAMMING Syllabus: What is Android? Obtaining the required tools, Anatomy

More information

Android Beginners Workshop

Android Beginners Workshop Android Beginners Workshop at the M O B IL E M O N D AY m 2 d 2 D E V E L O P E R D A Y February, 23 th 2010 Sven Woltmann, AndroidPIT Sven Woltmann Studied Computer Science at the TU Ilmenau, 1994-1999

More information

Mobile Programming Lecture 10. ContentProviders

Mobile Programming Lecture 10. ContentProviders Mobile Programming Lecture 10 ContentProviders Lecture 9 Review In creating a bound service, why would you choose to use a Messenger over extending Binder? What are the differences between using GPS provider

More information

PROGRAMMING APPLICATIONS DECLARATIVE GUIS

PROGRAMMING APPLICATIONS DECLARATIVE GUIS PROGRAMMING APPLICATIONS DECLARATIVE GUIS DIVING RIGHT IN Eclipse? Plugin deprecated :-( Making a new project This keeps things simple or clone or clone or clone or clone or clone or clone Try it

More information

Gauthier Picard. MINES Saint-Étienne. October 10, 2017

Gauthier Picard. MINES Saint-Étienne. October 10, 2017 Android Programming Gauthier Picard MINES Saint-Étienne October 10, 2017 This presentation is based on Jean-Paul Jamont s one (Université Pierre Mendès France, IUT de Valence) Android Programming Gauthier

More information

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics

10.1 Introduction. Higher Level Processing. Word Recogniton Model. Text Output. Voice Signals. Spoken Words. Syntax, Semantics, Pragmatics Chapter 10 Speech Recognition 10.1 Introduction Speech recognition (SR) by machine, which translates spoken words into text has been a goal of research for more than six decades. It is also known as automatic

More information

Mobila applikationer och trådlösa nät, HI1033, HT2012

Mobila applikationer och trådlösa nät, HI1033, HT2012 Mobila applikationer och trådlösa nät, HI1033, HT2012 Today: - User Interface basics - View components - Event driven applications and callbacks - Menu and Context Menu - ListView and Adapters - Android

More information

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion

External Services. CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion External Services CSE 5236: Mobile Application Development Course Coordinator: Dr. Rajiv Ramnath Instructor: Adam C. Champion 1 External Services Viewing websites Location- and map-based functionality

More information

AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI FARG ONA FILIALI

AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI FARG ONA FILIALI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI FARG ONA FILIALI Kompyuter injiniring fakulteti Axborot texnologiyalari kafedrasi

More information

Android JSON Parsing Tutorial

Android JSON Parsing Tutorial Android JSON Parsing Tutorial by Kapil - Thursday, May 19, 2016 http://www.androidtutorialpoint.com/networking/json-parsing-tutorial-android/ YouTube Video JSON(JavaScript Object Notation), is a language

More information

M.A.D Assignment # 1

M.A.D Assignment # 1 Submitted by: Rehan Asghar Roll no: BSSE (7) 15126 M.A.D Assignment # 1 Submitted to: Sir Waqas Asghar Submitted by: M. Rehan Asghar 4/25/17 Roll no: BSSE 7 15126 XML Code: Calculator Android App

More information

API Guide for Gesture Recognition Engine. Version 2.0

API Guide for Gesture Recognition Engine. Version 2.0 API Guide for Gesture Recognition Engine Version 2.0 Table of Contents Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket Library... 4 Project

More information

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters

Mobile Programming Lecture 5. Composite Views, Activities, Intents and Filters Mobile Programming Lecture 5 Composite Views, Activities, Intents and Filters Lecture 4 Review How do you get the value of a string in the strings.xml file? What are the steps to populate a Spinner or

More information

MyDatabaseHelper. public static final String TABLE_NAME = "tbl_bio";

MyDatabaseHelper. public static final String TABLE_NAME = tbl_bio; Page 1 of 5 MyDatabaseHelper import android.content.context; import android.database.sqlite.sqliteopenhelper; class MyDatabaseHelper extends SQLiteOpenHelper { private static final String DB_NAME = "friend_db";

More information

Android Apps Development for Mobile Game Lesson 5

Android Apps Development for Mobile Game Lesson 5 Workshop 1. Create a simple Environment Sensors (Page 1 6) Pressure Sensor Ambient Temperature Sensor Light Sensor Relative Humidity Sensor 2. Create a simple Position Sensors (Page 7 8) Proximity Sensor

More information

Learn about Android Content Providers and SQLite

Learn about Android Content Providers and SQLite Tampa Bay Android Developers Group Learn about Android Content Providers and SQLite Scott A. Thisse March 20, 2012 Learn about Android Content Providers and SQLite What are they? How are they defined?

More information

INTRODUCTION TO ANDROID

INTRODUCTION TO ANDROID INTRODUCTION TO ANDROID 1 Niv Voskoboynik Ben-Gurion University Electrical and Computer Engineering Advanced computer lab 2015 2 Contents Introduction Prior learning Download and install Thread Android

More information

Managing Data. However, we'll be looking at two other forms of persistence today: (shared) preferences, and databases.

Managing Data. However, we'll be looking at two other forms of persistence today: (shared) preferences, and databases. Managing Data This week, we'll be looking at managing information. There are actually many ways to store information for later retrieval. In fact, feel free to take a look at the Android Developer pages:

More information

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento

Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento Basic UI elements: Android Buttons (Basics) Marco Ronchetti Università degli Studi di Trento Let s work with the listener Button button = ; button.setonclicklistener(new.onclicklistener() { public void

More information