Presentation is loading. Please wait.

Presentation is loading. Please wait.

Subtitle touch | Title of presentation | Date DD/MM/YYYY Touch Cloud Android SDK Ghady Rayess – Jan 19 th, 2013.

Similar presentations


Presentation on theme: "Subtitle touch | Title of presentation | Date DD/MM/YYYY Touch Cloud Android SDK Ghady Rayess – Jan 19 th, 2013."— Presentation transcript:

1 Subtitle touch | Title of presentation | Date DD/MM/YYYY Touch Cloud Android SDK Ghady Rayess – Jan 19 th, 2013

2 Subtitle touch | Title of presentation | Date DD/MM/YYYY Introduction to Android Android Operation System o Android is an operating system based on Linux with a Java programming interface. o The Android Software Development Kit (Android SDK) provides all necessary tools to develop Android applications. o This includes a compiler, debugger and a device emulator, as well as its own virtual machine to run Android programs.

3 Subtitle touch | Title of presentation | Date DD/MM/YYYY Introduction to Android Google Play o Google Play is the premier store for distributing Android apps. o It’s preinstalled on more than 400 million devices worldwide, a number growing by more than a million every day. o Android users have downloaded more than 25 billion apps from Google Play, growing at a rate of more than 1.5 billion per month.

4 Subtitle touch | Title of presentation | Date DD/MM/YYYY Introduction to Android Quick facts

5 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Android versions

6 Subtitle touch | Title of presentation | Date DD/MM/YYYY Android Development Tools Android SDK o The Android Software Development Kit (SDK) contains the necessary tools to create, compile and package Android application. o The Android SDK also provides an Android device emulator, so that Android applications can be tested without a real Android phone. o You can create Android virtual devices (AVD) via the Android SDK, which run in this emulator. o The Android SDK contains the Android debug bridge (adb) tool which allows to connect to an virtual or real Android device.

7 Subtitle touch | Title of presentation | Date DD/MM/YYYY Android Development Tools SDK Manager: For managing/updating available SDKs

8 Subtitle touch | Title of presentation | Date DD/MM/YYYY Android Development Tools AVD Manager: Creating/Managing Virtual Devices

9 Subtitle touch | Title of presentation | Date DD/MM/YYYY Android Development Tools Android Emulator

10 Subtitle touch | Title of presentation | Date DD/MM/YYYY Hello World Creating a Project File -> New -> Android Application Project Proceed with default values

11 Subtitle touch | Title of presentation | Date DD/MM/YYYY Hello World Activities, XML Layout Files, Values: Strings

12 Subtitle touch | Title of presentation | Date DD/MM/YYYY Hello World Activities

13 Subtitle touch | Title of presentation | Date DD/MM/YYYY Hello World XML Layout Files: Graphical Layout & xml code

14 Subtitle touch | Title of presentation | Date DD/MM/YYYY Hello World Resources: Strings

15 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata Android SDK Apstrata Client http://wiki.apstrata.com/display/doc/Android+SDK

16 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata SDK Apstrata Client o Signed with username/password: ApstrataClientAndroid(String baseUrl, String key, String user, String password, AuthMode authMode) o Signed with secret: ApstrataClientAndroid(String baseUrl, String key, String secret, AuthMode authMode) o Unsigned: ApstrataClientAndroid(String baseUrl, String key, AuthMode authMode)

17 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata SDK API Calls o JSON Response: String callAPIJson(String methodName, List params, Map > files) o XML Response: public String callAPIXml(String methodName, List params, Map > files)

18 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata SDK Parameters o Passed to API Calls as List params o Creating a List of List parameters = new ArrayList (); parameters.add(new BasicNameValuePair(param1Key, param1Value));

19 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata SDK Files o Passed to API Calls as Map > files o Creating a Map of > List files = new ArrayList (); list.add(myFile1); Files.put(filesKey, files);

20 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata Example In HelloWorldProject: Part A: Making Apstrata Call – In MainActivity.java: Create ApstrataClient using username and password from previously created Asptrata account Choose an Apstrata API for testing Create parameters and files Call Asptrata API Log Result Part B: Displaying Result in TextView Create a new TextView in activity_main.xml Obtain reference to TextView in MainActivity.java Display Apstrata API result in TextView

21 Subtitle touch | Title of presentation | Date DD/MM/YYYY Apstrata Example Part 1 Code

22 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Overview Buy tickets Upload images Choose a concert Concert A Concert B Concert C Choose a concert Concert A Concert B Concert C Concert A Buy + + - - # tickets Total$$ Concert A Upload an image img1img2img3 img4img5 Save Title Desc Tags

23 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 1: Get List of Concerts ConcertsActivity Send Request to get list of concerts in JSON format Parse received JSON response Populate a list of Concerts Show received concerts in ListView Concert key: String title: String ticketPrice: double description: String date: Date documentKey: String picture: String pictureUrl: String

24 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 1: Get List of Concerts Eclipse [String getConcerts()]

25 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 1: Get List of Concerts – Solution http://www.foo.mobi/cloud/ConcertsActivity.java

26 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 1: Get list of concerts – Sample Response {"response": {"metadata": {"requestId": "8f401989-515b-4204-a539-7239769c93ce", "status": "success", "statusCode": "200" }, "result": {"documents": [{"key": "DavidGuattoConcert", "versionNumber": "1.0", "title": "David Guatto gone wild", "ticketPriceLL": "80000.0", "picture": "DavidGuattoGoneWild.jpg", "description": "Best Techno event of the year", "date": "2012-11-23T00:00:00+0000", "apsdb.documentKey": "DavidGuattoConcert"}, ……. ] }

27 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 2: Buy a Concert Ticket BuyTicketsActivity Populate user interface with concert parameters When user clicks Buy, send request with the following: name, msisdn, unitPrice, quantity, concertTitle Parse received JSON response Show success or fail message

28 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 2: Buy a Concert Ticket Eclipse [String buyConcertTicket ()]

29 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 2: Buy a Concert Ticket – Solution http://www.foo.mobi/cloud/BuyTicketsActivity.java

30 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 2: Buy a Concert Ticket – Sample Response {"response": {"metadata": {"requestId": "181eef41-42fd-457f-a106-1135379762a9", "status": "success", "statusCode": "200" }, "result": {"status": "success", "transactionId": "b5077a0f-7a10-45e0-a97f-8d913281647d" }

31 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 3: Get Concert Gallery Images ConcertGalleryActivity 1.Send Request to get list of concert images in JSON format 2.Parse received JSON response 3.Show received images in GridView GalleryImage key: String title: String picture: String pictureUrl: String

32 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 3: Get Concert Gallery Images Eclipse [String getConcertGallery ()]

33 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 3: Get Concert Gallery Images – Solution http://www.foo.mobi/cloud/ConcertGalleryActivity.java

34 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 3: Get Concert Gallery Images – Sample Response {"response": {"metadata": {"requestId": "8bfd1716-0e99-48ec-a4fd-129a04bf0abb", "status": "success", "statusCode": "200" }, "result": {"documents": [{"key": "image4", "versionNumber": "1.0", "picture": "DavidGuatto2.jpg", "title": "pic4" }, {"key": "image3", "versionNumber": "1.0", "picture": "DavidGuatto1.jpg", "title": "pic3" }] }

35 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 4: Upload an Image to a Concert ImageUploadActivity 1.User captures an image or selects one from phone gallery 2.User fills fields for image title, description, and tags 3.When user clicks Save, send request with the following parameters: title, description, tags, concert; and the file: picture 4.Parse received JSON response 5.Show success or fail message

36 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 4: Upload an Image to a Concert Eclipse [String uploadImageToConcert ()]

37 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 4: Upload an Image to a Concert – Solution http://www.foo.mobi/cloud/ImageUploadActivity.java

38 Subtitle touch | Title of presentation | Date DD/MM/YYYY Concerts Project Exercise 4: Upload an Image to a Concert – Sample Response {"response": {"metadata": {"requestId": "181eef41-42fd-457f-a106-1135379762a9", "status": "success", "statusCode": "200" }, "result": {"status": "success", "transactionId": "b5077a0f-7a10-45e0-a97f-8d913281647d" }

39 Subtitle touch | Title of presentation | Date DD/MM/YYYY THANK YOU!

40 Subtitle touch | Title of presentation | Date DD/MM/YYYY


Download ppt "Subtitle touch | Title of presentation | Date DD/MM/YYYY Touch Cloud Android SDK Ghady Rayess – Jan 19 th, 2013."

Similar presentations


Ads by Google