1 / 15

Programski jezici za mobilne aplikacije

Programski jezici za mobilne aplikacije. Ivana Šimić, 875 Katarina Vincetić, 898. Uvod. Početci: Apple – iPhone (2007.). Objective C C#. Java C/C++. Visual C++ C/C++. Java. Android OS. Operativni sustav Linux Android Inc.  Google 2005. Open source projekt Java, XML, HTML5. Java.

glyn
Download Presentation

Programski jezici za mobilne aplikacije

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programski jezici za mobilne aplikacije Ivana Šimić, 875 Katarina Vincetić, 898

  2. Uvod • Početci: Apple – iPhone (2007.) • Objective C • C# • Java • C/C++ • Visual C++ • C/C++ • Java

  3. Android OS • Operativni sustav • Linux • Android Inc.  Google 2005. • Open source projekt • Java, XML, HTML5

  4. Java • James Gosling 1995. • Java Virtual Machine (JVM) class HelloWorldApp { public static void main(String[] args) { System.out.println("Hello World!"); } }

  5. Programiranje mobilnih aplikacija za Android OS • Nativne aplikacije: • Izgled – XML • Događaji – Java + C/C++ • Web aplikacije: HTML5 + CSS3 uz JavaScript • Eclipse • Primjer: konverter (kn, €)

  6. Primjer 1. dio (XML) <?xmlversion="1.0"encoding="utf-8"?> <RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width="fill_parent„ android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> /* Ovdje ubacujemo elemente */ </RelativeLayout>

  7. Primjer 2. dio (XML) <LinearLayout android:layout_alignParentTop="true"android:layout_width="200dp"android:orientation="vertical"android:layout_height="280dp"android:id="@+id/linearlayoutId"> /* Ovdje ubacujemo elemente */ </LinearLayout> <TextViewandroid:id="@+id/TextView01"android:layout_width="wrap_content"android:layout_height="wrap_content„ android:text="Kune"android:textStyle="bold"></TextView> <EditTextandroid:layout_width="100dp"android:layout_height="45dp"android:id="@+id/kn"android:lines="1"></EditText>

  8. Primjer 3. dio (XML) <RadioGroupandroid:id="@+id/RadioGroup01"android:layout_width="wrap_content"android:layout_height="wrap_content"><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content" android:text="Kune u eure"android:id="@+id/knUe"></RadioButton><RadioButtonandroid:layout_width="wrap_content"android:layout_height="wrap_content" android:text="Euri u kune"android:id="@+id/eUkn"></RadioButton>

  9. Primjer 4. dio (XML) <Buttonandroid:layout_height="wrap_content"android:layout_width="wrap_content"android:layout_below="@+id/linearlayoutId"android:layout_alignRight="@+id/linearlayoutId"android:text="Pretvori"android:id="@+id/pretvori"></Button> • Gotov izgled!

  10. Primjer 5. dio (Java) package com.droidbd.currencyconverter; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.RadioButton; public class CurrencyConverter extends Activity implements OnClickListener { EditText kn; EditText euri; RadioButton knUe; RadioButton eUkn; Button pretvori; /*ovdje pišemo funkcije*/ }

  11. Primjer 6. dio (Java) public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); kn = (EditText)findViewById(R.id.kn); euri = (EditText)findViewById(R.id.euri); knUe = (RadioButton)this.findViewById(R.id.knUe); knUe.setChecked(true); eUkn = (RadioButton)this.findViewById(R.id.eUkn); pretvori = (Button)this.findViewById(R.id.pretvori); pretvori.setOnClickListener(this); }

  12. Primjer 7. dio (Java) public void onClick(View arg0) { if (knUe.isChecked()) { kn_e(); } if (eUkn.isChecked()) { e_kn(); } } protected void e_kn() { double val = Double.parseDouble(euri.getText().toString()); kn.setText(String.format( "%.2f", val*7.56 )); }

  13. HTML5 • Inačica HTML-a • <canvas> • <audio> • <video> • <article> • <header> • ...

  14. Zaključak • Operativni sustavi za mobilne uređaje • Nativne i web aplikacije • Android: • Nativne: Java, C/C++, XML • Web: HTML5, CSS3

  15. Literatura • Kim W. Tracy, Mobile application development experiences on Apple's iOS and Android OS, 2011 • Android - Discover Android, http://www.android.com/about/ (4.1.2013.) • Android Technical Information | Android Open Source, http://source.android.com/about/philosophy.html (4.1.2013.) • Android Tutorial - How to create a GUI application in Android, http://www.skill-guru.com/blog/2011/01/18/currencyconverter-tutorial/ (3.1.2013.) • David Meyer, Mobile Application Development: Must Know Key Point Aspects, http://www.webgranth.com/mobile-application-development-must-know-key-point-aspects (3.1.2013.) • HTML5 introduction, http://www.w3schools.com/html/html5_intro.asp (4.1.2013.)

More Related