SlideShare a Scribd company logo
Tips & Third Party
Library for Android
OLEH IBNU SINA WARDY
Overview
Action Bar
Sliding Menu
JSON Parsing
Tablet Dimension
TIPS & THIRD PARTY LIBRARY FOR ANDROID 2
Action Bar
TIPS & THIRD PARTY LIBRARY FOR ANDROID 3
Action Bar
ICS Froyo
TIPS & THIRD PARTY LIBRARY FOR ANDROID 4
Action Bar
ICS Froyo
getActionBar().setDisplayHomeAsUpEnabled(true);
TIPS & THIRD PARTY LIBRARY FOR ANDROID 5
Action Bar
ICS Froyo
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Library agar ActionBar tetap ada
untuk device di bawah Honeycomb:
ActionBarSherlock
http://actionbarsherlock.com
TIPS & THIRD PARTY LIBRARY FOR ANDROID 6
Cara Pakai
ActionBarSherlock
Import Project di Eclipse dan tambahkan sebagai library untuk aplikasi
Gunakan extend milik library
◦ Activity  SherlockActivity
◦ Fragment  SherlockFragment
◦ FragmentActivity  SherlockFragmentActivity
◦ ListAcitivity  SherlockListAcitivity
Untuk mengakses Action Bar, gunakan getSupportActionBar()
Pastikan gunakan class milik ActionBarSherlock
◦ com.actionbarsherlock.app.ActionBar
◦ com.actionbarsherlock.view.Menu
◦ com.actionbarsherlock.view.MenuItem
◦ com.actionbarsherlock.view.MenuInflater
TIPS & THIRD PARTY LIBRARY FOR ANDROID 7
Sliding Menu
TIPS & THIRD PARTY LIBRARY FOR ANDROID 8
Navigation Drawer
TIPS & THIRD PARTY LIBRARY FOR ANDROID 9
Membuat Drawer Layout
TIPS & THIRD PARTY LIBRARY FOR ANDROID 10
Membuat Aksi Buka / Tutup
DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
getActionBar().setTitle(mTitle);
invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
/** Called when a drawer has settled in a completely open state. */
public void onDrawerOpened(View drawerView) {
getActionBar().setTitle(mDrawerTitle);
invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu()
}
};
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
TIPS & THIRD PARTY LIBRARY FOR ANDROID 11
Buka / Tutup dengan icon
up
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerToggle = new ActionBarDrawerToggle(
this, /* host Activity */
mDrawerLayout, /* DrawerLayout object */
R.drawable.ic_drawer, /* nav drawer icon to replace 'Up' caret */
R.string.drawer_open, /* "open drawer" description */
R.string.drawer_close /* "close drawer" description */
) {
/** Called when a drawer has settled in a completely closed state. */
public void onDrawerClosed(View view) {
getActionBar().setTitle(mTitle);
}
/** Called when a drawer has settled in a completely open state. */
public void onDrawerOpened(View drawerView) {
getActionBar().setTitle(mDrawerTitle);
}
};
// Set the drawer toggle as the DrawerListener
mDrawerLayout.setDrawerListener(mDrawerToggle);
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
TIPS & THIRD PARTY LIBRARY FOR ANDROID 12
Library SlidingMenu
Url: https://github.com/jfeinstein10/SlidingMenu
Lebih mudah diimplementasikan
Dapat membuat sliding menu di kiri dan di kanan
Tetapi:
◦ Tidak mempunyai icon garis tiga di actionbar
◦ Menu tidak floating di atas konten
TIPS & THIRD PARTY LIBRARY FOR ANDROID 13
Penggunakan SlidingMenu
TIPS & THIRD PARTY LIBRARY FOR ANDROID 14
JSON Parsing
TIPS & THIRD PARTY LIBRARY FOR ANDROID 15
JSON
TIPS & THIRD PARTY LIBRARY FOR ANDROID 16
Basic Parsing
JSONObject jObj = new JSONObject(strFromUrl);
int id = jObj.getInt("id");
String name = jObj.getString("name");
String address = jObj.getString("address");
String contact = jObj.getString("contact");
//.... dan seterusnya
TIPS & THIRD PARTY LIBRARY FOR ANDROID 17
Gson
Unduh library Gson
◦ https://code.google.com/p/google-gson/
Ekstrak hasil unduh dan letakkan library jar ke folder libs di project
Buat kelas model yang mempresentasikan json yang akan diparsing
TIPS & THIRD PARTY LIBRARY FOR ANDROID 18
Contoh kelas model
public class RestaurantDao {
String id;
String name;
String address;
String contact;
String links;
String about;
String lat;
String lng;
String currency;
String minprice;
String maxprice;
//.... dan seterusnya
}
TIPS & THIRD PARTY LIBRARY FOR ANDROID 19
Parsing menggunakan
Gson
Gson gson = new Gson();
RestaurantDao restaurant = gson.fromJson(strFromUrl,
RestaurantDao.class);
TIPS & THIRD PARTY LIBRARY FOR ANDROID 20
Tablet
Dimension
TIPS & THIRD PARTY LIBRARY FOR ANDROID 21
Dimension for Tablet
Nexus S Galaxy Tab 10.1
TIPS & THIRD PARTY LIBRARY FOR ANDROID 22
dimens.xml
/values/dimens.xml
/values-sw600dp/dimens.xml
<resources>
<dimen name=“text_14sp”>14sp</dimen>
<dimen name=“dimen_10dp”>10dp</dimen>
</resources>
<resources>
<dimen name=“text_14sp”>24sp</dimen>
<dimen name=“dimen_10dp”>20dp</dimen>
</resources>
TIPS & THIRD PARTY LIBRARY FOR ANDROID 23
Dimension compatibility
Nexus S Galaxy Tab 10.1
TIPS & THIRD PARTY LIBRARY FOR ANDROID 24
Tips dan Third Party Library untuk Android - Part 1
Work with Us - PT GITS Indonesia
Jalan Jatimulya 1 No 14, Bandung
Jalan Rembang No 17, Menteng, Jakarta Pusat
26
Ad

More Related Content

Viewers also liked (20)

Security threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsSecurity threats in Android OS + App Permissions
Security threats in Android OS + App Permissions
Hariharan Ganesan
 
Android(1)
Android(1)Android(1)
Android(1)
Nikola Milosevic
 
Anatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAnatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shop
Abhinav Mishra
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
Vivek Bhusal
 
Android permission system
Android permission systemAndroid permission system
Android permission system
Shivang Goel
 
Sandbox Introduction
Sandbox IntroductionSandbox Introduction
Sandbox Introduction
msimkin
 
Android permission system
Android permission systemAndroid permission system
Android permission system
Shivang Goel
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
Bin Yang
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
Perfect APK
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change
彥彬 洪
 
Json Tutorial
Json TutorialJson Tutorial
Json Tutorial
Napendra Singh
 
Android new permission model
Android new permission modelAndroid new permission model
Android new permission model
Takuji Nishibayashi
 
Basic Android Push Notification
Basic Android Push NotificationBasic Android Push Notification
Basic Android Push Notification
Chaiyasit Tayabovorn
 
JSON overview and demo
JSON overview and demoJSON overview and demo
JSON overview and demo
Flatiron School
 
Simple JSON parser
Simple JSON parserSimple JSON parser
Simple JSON parser
Dongjun Lee
 
App Permissions
App PermissionsApp Permissions
App Permissions
Shinobu Okano
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
pundiramit
 
Android webservices
Android webservicesAndroid webservices
Android webservices
Krazy Koder
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – example
Rajat Ghai
 
Android security
Android securityAndroid security
Android security
Krazy Koder
 
Security threats in Android OS + App Permissions
Security threats in Android OS + App PermissionsSecurity threats in Android OS + App Permissions
Security threats in Android OS + App Permissions
Hariharan Ganesan
 
Anatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shopAnatomizing online payment systems: hack to shop
Anatomizing online payment systems: hack to shop
Abhinav Mishra
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
Vivek Bhusal
 
Android permission system
Android permission systemAndroid permission system
Android permission system
Shivang Goel
 
Sandbox Introduction
Sandbox IntroductionSandbox Introduction
Sandbox Introduction
msimkin
 
Android permission system
Android permission systemAndroid permission system
Android permission system
Shivang Goel
 
Android secuirty permission - upload
Android secuirty   permission - uploadAndroid secuirty   permission - upload
Android secuirty permission - upload
Bin Yang
 
Android AsyncTask Tutorial
Android AsyncTask TutorialAndroid AsyncTask Tutorial
Android AsyncTask Tutorial
Perfect APK
 
Android 6.0 permission change
Android 6.0 permission changeAndroid 6.0 permission change
Android 6.0 permission change
彥彬 洪
 
Simple JSON parser
Simple JSON parserSimple JSON parser
Simple JSON parser
Dongjun Lee
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
pundiramit
 
Android webservices
Android webservicesAndroid webservices
Android webservices
Krazy Koder
 
Android json parser tutorial – example
Android json parser tutorial – exampleAndroid json parser tutorial – example
Android json parser tutorial – example
Rajat Ghai
 
Android security
Android securityAndroid security
Android security
Krazy Koder
 

Similar to Tips dan Third Party Library untuk Android - Part 1 (20)

Android Lollipop - Webinar am 11.12.2014
Android Lollipop - Webinar am 11.12.2014Android Lollipop - Webinar am 11.12.2014
Android Lollipop - Webinar am 11.12.2014
inovex GmbH
 
Material Design and Backwards Compatibility
Material Design and Backwards CompatibilityMaterial Design and Backwards Compatibility
Material Design and Backwards Compatibility
Angelo Rüggeberg
 
Android Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAndroid Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation Drawer
Agus Haryanto
 
Action bar
Action barAction bar
Action bar
Mu Chun Wang
 
ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+
Michal Pavlasek
 
APPlause - DemoCamp Munich
APPlause - DemoCamp MunichAPPlause - DemoCamp Munich
APPlause - DemoCamp Munich
Peter Friese
 
My Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveCMy Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveC
JohnKennedy
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
Ahsanul Karim
 
Android basic 4 Navigation Drawer
Android basic 4 Navigation DrawerAndroid basic 4 Navigation Drawer
Android basic 4 Navigation Drawer
Eakapong Kattiya
 
Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
cbeyls
 
Dinosaurs and Androids: The Listview Evolution
Dinosaurs and Androids: The Listview EvolutionDinosaurs and Androids: The Listview Evolution
Dinosaurs and Androids: The Listview Evolution
Fernando Cejas
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
Prof. Erwin Globio
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
 
Android App Development - 05 Action bar
Android App Development - 05 Action barAndroid App Development - 05 Action bar
Android App Development - 05 Action bar
Diego Grancini
 
Android Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAndroid Survival Guide - Two years of software development
Android Survival Guide - Two years of software development
Alfredo Morresi
 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrap
donnfelker
 
What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024
Toru Wonyoung Choi
 
Fewd week6 slides
Fewd week6 slidesFewd week6 slides
Fewd week6 slides
William Myers
 
Android Design Patterns
Android Design PatternsAndroid Design Patterns
Android Design Patterns
Godfrey Nolan
 
More android code puzzles
More android code puzzlesMore android code puzzles
More android code puzzles
Danny Preussler
 
Android Lollipop - Webinar am 11.12.2014
Android Lollipop - Webinar am 11.12.2014Android Lollipop - Webinar am 11.12.2014
Android Lollipop - Webinar am 11.12.2014
inovex GmbH
 
Material Design and Backwards Compatibility
Material Design and Backwards CompatibilityMaterial Design and Backwards Compatibility
Material Design and Backwards Compatibility
Angelo Rüggeberg
 
Android Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAndroid Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation Drawer
Agus Haryanto
 
ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+ActionBar and Holo in Android 2+
ActionBar and Holo in Android 2+
Michal Pavlasek
 
APPlause - DemoCamp Munich
APPlause - DemoCamp MunichAPPlause - DemoCamp Munich
APPlause - DemoCamp Munich
Peter Friese
 
My Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveCMy Favourite 10 Things about Xcode/ObjectiveC
My Favourite 10 Things about Xcode/ObjectiveC
JohnKennedy
 
Action Bar Sherlock tutorial
Action Bar Sherlock tutorialAction Bar Sherlock tutorial
Action Bar Sherlock tutorial
Ahsanul Karim
 
Android basic 4 Navigation Drawer
Android basic 4 Navigation DrawerAndroid basic 4 Navigation Drawer
Android basic 4 Navigation Drawer
Eakapong Kattiya
 
Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
cbeyls
 
Dinosaurs and Androids: The Listview Evolution
Dinosaurs and Androids: The Listview EvolutionDinosaurs and Androids: The Listview Evolution
Dinosaurs and Androids: The Listview Evolution
Fernando Cejas
 
Workshop 26: React Native - The Native Side
Workshop 26: React Native - The Native SideWorkshop 26: React Native - The Native Side
Workshop 26: React Native - The Native Side
Visual Engineering
 
Android App Development - 05 Action bar
Android App Development - 05 Action barAndroid App Development - 05 Action bar
Android App Development - 05 Action bar
Diego Grancini
 
Android Survival Guide - Two years of software development
Android Survival Guide - Two years of software developmentAndroid Survival Guide - Two years of software development
Android Survival Guide - Two years of software development
Alfredo Morresi
 
Android Bootstrap
Android BootstrapAndroid Bootstrap
Android Bootstrap
donnfelker
 
What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024What's new in android: jetpack compose 2024
What's new in android: jetpack compose 2024
Toru Wonyoung Choi
 
Android Design Patterns
Android Design PatternsAndroid Design Patterns
Android Design Patterns
Godfrey Nolan
 
More android code puzzles
More android code puzzlesMore android code puzzles
More android code puzzles
Danny Preussler
 
Ad

Recently uploaded (20)

How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Ad

Tips dan Third Party Library untuk Android - Part 1

  • 1. Tips & Third Party Library for Android OLEH IBNU SINA WARDY
  • 2. Overview Action Bar Sliding Menu JSON Parsing Tablet Dimension TIPS & THIRD PARTY LIBRARY FOR ANDROID 2
  • 3. Action Bar TIPS & THIRD PARTY LIBRARY FOR ANDROID 3
  • 4. Action Bar ICS Froyo TIPS & THIRD PARTY LIBRARY FOR ANDROID 4
  • 6. Action Bar ICS Froyo getSupportActionBar().setDisplayHomeAsUpEnabled(true); Library agar ActionBar tetap ada untuk device di bawah Honeycomb: ActionBarSherlock http://actionbarsherlock.com TIPS & THIRD PARTY LIBRARY FOR ANDROID 6
  • 7. Cara Pakai ActionBarSherlock Import Project di Eclipse dan tambahkan sebagai library untuk aplikasi Gunakan extend milik library ◦ Activity  SherlockActivity ◦ Fragment  SherlockFragment ◦ FragmentActivity  SherlockFragmentActivity ◦ ListAcitivity  SherlockListAcitivity Untuk mengakses Action Bar, gunakan getSupportActionBar() Pastikan gunakan class milik ActionBarSherlock ◦ com.actionbarsherlock.app.ActionBar ◦ com.actionbarsherlock.view.Menu ◦ com.actionbarsherlock.view.MenuItem ◦ com.actionbarsherlock.view.MenuInflater TIPS & THIRD PARTY LIBRARY FOR ANDROID 7
  • 8. Sliding Menu TIPS & THIRD PARTY LIBRARY FOR ANDROID 8
  • 9. Navigation Drawer TIPS & THIRD PARTY LIBRARY FOR ANDROID 9
  • 10. Membuat Drawer Layout TIPS & THIRD PARTY LIBRARY FOR ANDROID 10
  • 11. Membuat Aksi Buka / Tutup DrawerLayout mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) { /** Called when a drawer has settled in a completely closed state. */ public void onDrawerClosed(View view) { getActionBar().setTitle(mTitle); invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu() } /** Called when a drawer has settled in a completely open state. */ public void onDrawerOpened(View drawerView) { getActionBar().setTitle(mDrawerTitle); invalidateOptionsMenu(); // creates call to onPrepareOptionsMenu() } }; // Set the drawer toggle as the DrawerListener mDrawerLayout.setDrawerListener(mDrawerToggle); TIPS & THIRD PARTY LIBRARY FOR ANDROID 11
  • 12. Buka / Tutup dengan icon up mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); mDrawerToggle = new ActionBarDrawerToggle( this, /* host Activity */ mDrawerLayout, /* DrawerLayout object */ R.drawable.ic_drawer, /* nav drawer icon to replace 'Up' caret */ R.string.drawer_open, /* "open drawer" description */ R.string.drawer_close /* "close drawer" description */ ) { /** Called when a drawer has settled in a completely closed state. */ public void onDrawerClosed(View view) { getActionBar().setTitle(mTitle); } /** Called when a drawer has settled in a completely open state. */ public void onDrawerOpened(View drawerView) { getActionBar().setTitle(mDrawerTitle); } }; // Set the drawer toggle as the DrawerListener mDrawerLayout.setDrawerListener(mDrawerToggle); getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setHomeButtonEnabled(true); TIPS & THIRD PARTY LIBRARY FOR ANDROID 12
  • 13. Library SlidingMenu Url: https://github.com/jfeinstein10/SlidingMenu Lebih mudah diimplementasikan Dapat membuat sliding menu di kiri dan di kanan Tetapi: ◦ Tidak mempunyai icon garis tiga di actionbar ◦ Menu tidak floating di atas konten TIPS & THIRD PARTY LIBRARY FOR ANDROID 13
  • 14. Penggunakan SlidingMenu TIPS & THIRD PARTY LIBRARY FOR ANDROID 14
  • 15. JSON Parsing TIPS & THIRD PARTY LIBRARY FOR ANDROID 15
  • 16. JSON TIPS & THIRD PARTY LIBRARY FOR ANDROID 16
  • 17. Basic Parsing JSONObject jObj = new JSONObject(strFromUrl); int id = jObj.getInt("id"); String name = jObj.getString("name"); String address = jObj.getString("address"); String contact = jObj.getString("contact"); //.... dan seterusnya TIPS & THIRD PARTY LIBRARY FOR ANDROID 17
  • 18. Gson Unduh library Gson ◦ https://code.google.com/p/google-gson/ Ekstrak hasil unduh dan letakkan library jar ke folder libs di project Buat kelas model yang mempresentasikan json yang akan diparsing TIPS & THIRD PARTY LIBRARY FOR ANDROID 18
  • 19. Contoh kelas model public class RestaurantDao { String id; String name; String address; String contact; String links; String about; String lat; String lng; String currency; String minprice; String maxprice; //.... dan seterusnya } TIPS & THIRD PARTY LIBRARY FOR ANDROID 19
  • 20. Parsing menggunakan Gson Gson gson = new Gson(); RestaurantDao restaurant = gson.fromJson(strFromUrl, RestaurantDao.class); TIPS & THIRD PARTY LIBRARY FOR ANDROID 20
  • 21. Tablet Dimension TIPS & THIRD PARTY LIBRARY FOR ANDROID 21
  • 22. Dimension for Tablet Nexus S Galaxy Tab 10.1 TIPS & THIRD PARTY LIBRARY FOR ANDROID 22
  • 23. dimens.xml /values/dimens.xml /values-sw600dp/dimens.xml <resources> <dimen name=“text_14sp”>14sp</dimen> <dimen name=“dimen_10dp”>10dp</dimen> </resources> <resources> <dimen name=“text_14sp”>24sp</dimen> <dimen name=“dimen_10dp”>20dp</dimen> </resources> TIPS & THIRD PARTY LIBRARY FOR ANDROID 23
  • 24. Dimension compatibility Nexus S Galaxy Tab 10.1 TIPS & THIRD PARTY LIBRARY FOR ANDROID 24
  • 26. Work with Us - PT GITS Indonesia Jalan Jatimulya 1 No 14, Bandung Jalan Rembang No 17, Menteng, Jakarta Pusat 26