![Page 1: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/1.jpg)
A Case Study of Mobile
Application Development
Wei Dong
Samsung Electronics
![Page 2: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/2.jpg)
2
Content
• Tizen Application Development
• Practices of Tizen Application Development
• Performance optimization
• Memory usage
• Database usage
![Page 3: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/3.jpg)
Tizen Application
Development
![Page 4: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/4.jpg)
4
Application Development - Start from Here
Platform Application
Framework
UI Functionalities
![Page 5: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/5.jpg)
5
Tizen Architecture
Web Applications
W3C/HTML5 Device APIs Web UI FW
Web Runtime Native Applications
Web Framework
Application
Framework
Security
System
Content
Graphics &
UI
Social
Multimedia
Messaging
Network &
Connectivity
Web
Telephony
Base & OSS
Location
Linux Kernel & device drivers
Native Subsystems
Kernel
Web
API
Native
API
![Page 6: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/6.jpg)
6
EFL Architecture
Applications, Libraries, Services
Elementary
Efreet Eio Eeze Ethumb Eldbus Emotion
Ecore
Eet
Eina
BASE OPERATING SYSTEM / DISPLAY ETC.
Embryo
Edje
Evas Evas
![Page 7: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/7.jpg)
7
Case Study: Contact Application
Contact Application
Linux Kernel
Graphics & UI
Elementary
Edje Ecore
Evas
Eina
Base &
OSS
Te
lep
ho
ny
SQLite 3
Ap
plic
atio
n F
WK
Dialer
Msg.
… Service
…
UI
![Page 8: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/8.jpg)
8
Application Lifecycle
Created Terminated Ready
Running Paused
app_pause_cb()
app_resume_cb()
/app_control_cb()
app_terminate_cb() app_create_cb()
app_control_cb()
app_resume_cb() app_terminate_cb()
app_control_cb()
![Page 9: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/9.jpg)
9
Sample Code of main()
int main(int argc, char *argv[])
{
struct appdata ad;
app_event_callback_s event_callbacks;
event_callbacks.create = ct_create;
event_callbacks.terminate = ct_terminate;
event_callbacks.pause = ct_pause;
event_callbacks.resume = ct_resume;
event_callbacks.app_control = ct_app_control;
…
return app_efl_main(&argc, &argv, &event_callbacks, &ad);
}
![Page 10: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/10.jpg)
10
UI Analysis
• Layout
• Widget selection
Layout Data Content
Benny
Berton
…
icon text
![Page 11: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/11.jpg)
11
Edje
• A complex graphical design and layout library
• Create visual layouts from compiled EDC script
• Support relative and absolute positioning
collections { - list the groups.
group { - the list of parts and programs that compose a given edje object.
images { } – list each image file that will be used in the edc.
parts {
part { - the most basic design elements of the group.
(i.e. RECT, TEXT, IMAGE, SWALLOW, TEXTBLOCK, GROUP, BOX, TABLE, EXTERNAL)
}
}
programs {
program { - manipulates the different interface elements and serve as a bridge between
the application and interface.
}
}
}
}
![Page 12: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/12.jpg)
12
Scalability
• Relative position
rel1(1.0, 0.0) to: “icon”
rel2(1.0, 1.0)
icon text
![Page 13: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/13.jpg)
13
Sample Code of UI Layout
group {
name: "item";
parts {
part {
name: “icon";
type: SWALLOW;
description {
state: "default" 0.0;
min: 72 0;
align: 0.0 0.5;
fixed: 1 0;
rel1 { relative: 0.0 0.0 ;}
rel2 { relative: 0.0 1.0 ;}
}
}
part {
name: “text";
type: TEXT;
description {
state: "default" 0.0;
rel1 { relative: 1.0 0.0 ; to: “icon";}
rel2 { relative: 1.0 1.0 ; }
}
}
…
}
…
![Page 14: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/14.jpg)
14
Application View
• View control with naviframe
![Page 15: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/15.jpg)
15
Building Application
• Separation of layout and logic
• A graphical part: GUI layout binary (edj)
• A functionality: executable logic binary (C)
![Page 16: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/16.jpg)
Practices of
Performance
Optimization
![Page 17: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/17.jpg)
17
Launching Performance Analysis
• Synchronized procedure • Poor performance for mass data
Create main
window
Connect DB
service
Create list view
Get all records
from DB
Show list view
App Condition Launching
Time
Contact 10000 records 2.27s
![Page 18: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/18.jpg)
18
Processing in Parallel
App Condition Launching
Time
Contact 10000 records 1.53s
• Multi-threads processing • Retrieving data asynchronously
Create main
window
Connect DB
service
Create list view Get all records
from DB
Show list view
Update list
![Page 19: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/19.jpg)
19
Further Optimization
• Splitting data loading • Retrieving necessary data for display
• Loading rest data in idle state
App Condition
Launching
Time
Contact 10000 records 1.04s
Create main
window
Connect DB
service
Create list view Get first records
from DB
Show list view
Update list
Get rest records
from DB
Update list
![Page 20: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/20.jpg)
20
• Create list item with elm_genlist_homogeneous_set()
List Items Loading
100
100
100
100
…
…
Evas_Object *ct_create_genlist(…)
{
…
genlist = elm_genlist_add (parent);
elm_genlist_homogeneous_set(genlist, EINA_TRUE);
…
elm_genlist_item_append(…);
…
}
The height of list
items should be same
![Page 21: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/21.jpg)
Practices of Memory
Usage
![Page 22: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/22.jpg)
22
Memory Tool in Tizen
• Valgrind • For memory debugging, memory leak detection, and profiling
Null pointer dereference
Memory leak
![Page 23: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/23.jpg)
23
Widget Object Release
• Lifecycle of widget object
scroller layout
box
Image
button
entry
De
str
oy e
ach
ob
ject
![Page 24: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/24.jpg)
24
User Data Release
• Event in object destroy • EVAS_CALLBACK_DEL
x
scroller layout
box
Image
button
entry Entry destroy procedure
EVAS_CALLBACK_DEL
scroller layout
box
Image
button Destroy entry object
![Page 25: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/25.jpg)
Practices of
Database Usage
![Page 26: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/26.jpg)
26
Database Engine in Tizen
• SQLite 3 • A popular choice as embedded database
• No wrapper in Tizen platform
• Practices of SQLite3 • Concurrency control
• Use mutex in application side
• API usage in application • sqlite3_exec()
• sqlite3_prepare_v2() & sqlite3_step()
Database
SQLite3
Contact Application
![Page 27: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/27.jpg)
27
Media Content Framework
Application
Video Player Music Player Gallery …
Media Content CAPI
Media Content Framework
File Scanner Media Database
File System SQLite3
Media
Info Metadata Thumbnail Playlist Folder Bookmark Tag Search
• CRUD media information from/to database
• Managed content: image/video/audio files
![Page 28: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/28.jpg)
28
Case Study: Music Player with Media Content
…
/* initialize */
media_content_connect(…);
/* create filter */
filter = media_filter_create(…);
/* get audio file count */
media_info_get_media_count_from_db(…);
/* set filter property (SQL prepare) */
media_filter_set_order(…);
media_filter_set_condition(…);
media_filter_set_offset(...);
/* query audio file list from media content */
media_info_foreach_media_from_db(…);
…
/* monitor audio file update */
media_content_set_db_updated_cb(…);
…
/* Finalize */
media_content_disconnect(…);
…
Get media info
…
/* initialize */
media_content_connect(…);
media_info_get_media_from_db(…);
media_info_get_audio(…);
audio_meta_get_sample_rate(…);
audio_meta_get_duration(…);
…
/* Finalize */
media_content_disconnect(…);
…
Get Metadata
![Page 29: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/29.jpg)
Thanks!
![Page 30: A Case Study of Mobile Application Development - Tizendownload.tizen.org/misc/media/tds2014/slides/ACaseStudyMobile... · A Case Study of Mobile Application Development ... BASE OPERATING](https://reader034.vdocuments.us/reader034/viewer/2022042611/5ac566aa7f8b9a2b5c8d94e6/html5/thumbnails/30.jpg)