Download presentation
Presentation is loading. Please wait.
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
/* Ovdje ubacujemo elemente */
Primjer 1. dio (XML) <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:layout_width="fill_parent„ android:layout_height="fill_parent" xmlns:android=" /* Ovdje ubacujemo elemente */ </RelativeLayout>
7
/* Ovdje ubacujemo elemente */
Primjer 2. dio (XML) <LinearLayout android:layout_alignParentTop="true" android:layout_width="200dp" android:orientation="vertical" android:layout_height="280dp" /* Ovdje ubacujemo elemente */ </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content„ android:text="Kune" android:textStyle="bold"></TextView> <EditText android:layout_width="100dp" android:layout_height="45dp" android:lines="1"></EditText>
8
Primjer 3. dio (XML) <RadioGroup android:layout_width="wrap_content" android:layout_height="wrap_content"><RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Kune u eure" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Euri u kune"
9
Primjer 4. dio (XML) Gotov izgled!
<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Pretvori" Gotov izgled!
10
/*ovdje pišemo funkcije*/
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> ... <!DOCTYPE html> <html> <head> <title>Naslov dokumenta </title> </head> <body> Tijelo dokumenta... </body> </html>
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, ( ) Android Technical Information | Android Open Source, ( ) Android Tutorial - How to create a GUI application in Android, ( ) David Meyer, Mobile Application Development: Must Know Key Point Aspects, ( ) HTML5 introduction, ( )
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.