SlideShare a Scribd company logo
1 of 13
Download to read offline
Android Storage
- Internal & External Storages
(Honeycomb 3.2)
William.L
wiliwe@gmail.com
2011-09-10
Outline
Storage Configuration File
Internal Storage Configuration
External Storage Configuration
Storage Settings
Storage Configuration File (1/2)
Since Android Honeycomb 3.0 , it uses a
configuration file to control which volume should
be mounted.
Storage Configuration File
Honeycomb 3.0 :
/device/SoCVendorName/SoCModelName/overlay/fram
eworks/base/core/res/res/values/config.xml
Honeycomb 3.2 :
/device/SoCVendorName/SoCModelName/overlay/fram
eworks/base/core/res/res/xml/storage_list.xml
Storage Configuration File (2/2)
When MoutService initializes,
it reads and parses storage configuration file
and stores information from storage configuration file
into a variable of StorageVolume type
MountService.MountService()
MountService.readStorageList()
Storage
Configuration
File
call
read
Internal Storage Configuration (1/2)
Since Android Honeycomb 3.0 , the internal
storage is formed by remapping /data/media to
/sdcard through FUSE for MTP usage.
Following steps are for volume mounting :
Mount /dev/block/mmcblk0p3(the actual partition is
depending on your device) to /data, descripted in
init.rc
mkdir /sdcard, /data/media
Remap /data/media to /sdcard in FUSE using the tool
/system/bin/sdcard (source code is
/system/core/sdcard) utility in init.ventana.rc
Export ”EXTERNAL_STORAGE“ environmental
variable with value “/sdcard”
MountService bind /sdcard to MtpService in Java
layer
Internal Storage Configuration (2/2)
In storge configuration file, the configuration for
Internal Storage could be:
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
<storage android:mountPoint="/mnt/sdcard"
android:storageDescription="@string/storage_internal"
android:primary="true"
android:emulated="true"
android:mtpReserve="100" />
</StorageList>
The string variable after “@string/” could be found
in /frameworks/base/core/res/res/values/strings.xml
External Storage Configuration (1/2)
In storge configuration file, the configuration for
SD card could be:
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
<storage android:mountPoint="/mnt/sdcard2"
android:storageDescription="@string/storage_sd_card"
android:removable="true" />
</StorageList>
The string variable after “@string/” could be found
in /frameworks/base/core/res/res/values/strings.xml
External Storage Configuration (2/2)
In storge configuration file, the configuration for
USB stick(thumbdrive) could be:
<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
<storage android:mountPoint="/mnt/usbdrive"
android:storageDescription="@string/storage_usb"
android:removable="true" />
</StorageList>
The string variable after “@string/” could be found
in /frameworks/base/core/res/res/values/strings.xml
Storage Settings (1/5)
The "Storage" settings form(layout)
/packages/apps/Settings/res/xml/device_info_memory.
xml
UI strings like "Available space", "Total space"
values are defined in
/packages/apps/Settings/res/values/strings.xml
Storage Settings (2/5)
/packages/apps/Settings/src/com/android/settings/
deviceinfo/Memory.java
Use StorageManager to get MountService instance
and the number of storages in the system.
There has a BroadcastReceiver,
MediaScannerReceiver, that receives
ACTION_MEDIA_SCANNER_STARTED intent when
a storage plugging into the device.
Register a storage listener (of IMountService)
implementing onStorageStateChanged() interface
which is called by MountService's method
updatePublicVolumeState().
Storage Settings (3/5)
/packages/apps/Settings/src/com/android/settings/
deviceinfo/Memory.java
When MoutService initializes, it parses storage_list.xml
and stores information likes the amount of storages in the
system, mount-point, removable or not, storage name in
a variable typed in StorageVolume. These storage
information will be stored in an array in type of
StorageVolumePreferenceCategory when onCreate() is
run. The sequence to put the information into the array
(StorageVolumePreferenceCategory type) determines
the showing sequence in storage settings.
Storage Settings (4/5)
/packages/apps/Settings/src/com/android/settings/
deviceinfo/Memory.java
Finally, using StorageVolumePreferenceCategory.init() to
create storage usage statics diagram。
P.S : this class process click event of Preference in the
method onPreferenceTreeClick()
Storage Settings (5/5)
/packages/apps/Settings/src/com/android/settings/
deviceinfo/StorageVolumePreferenceCatagory.java
In method getInstance(), it uses StorageMeasurement
class to recored the usage of each storage volume.
Using Map data structure to record StorageVolume and
StorageMeasurement pair.
Each StorageVolume object correspond to a
StorageVolumePreferenceCategory object; each
StorageVolumePreferenceCategory object has a
StorageMeasurement object.

More Related Content

What's hot

Android App Development - 09 Storage
Android App Development - 09 StorageAndroid App Development - 09 Storage
Android App Development - 09 StorageDiego Grancini
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - VoldWilliam Lee
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernelAdrian Huang
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile appsIvano Malavolta
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File SystemAdrian Huang
 
Building node.js applications with Database Jones
Building node.js applications with Database JonesBuilding node.js applications with Database Jones
Building node.js applications with Database JonesJohn David Duncan
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageOliver Scheer
 
03 programmation mobile - android - (stockage, multithreads, web services)
03 programmation mobile - android - (stockage, multithreads, web services)03 programmation mobile - android - (stockage, multithreads, web services)
03 programmation mobile - android - (stockage, multithreads, web services)TECOS
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userDesty Yani
 
香港六合彩
香港六合彩香港六合彩
香港六合彩iewsxc
 
Keras CNN Pre-trained Deep Learning models for Flower Recognition
Keras CNN Pre-trained Deep Learning models for Flower RecognitionKeras CNN Pre-trained Deep Learning models for Flower Recognition
Keras CNN Pre-trained Deep Learning models for Flower RecognitionFatima Qayyum
 

What's hot (20)

Persistences
PersistencesPersistences
Persistences
 
Android App Development - 09 Storage
Android App Development - 09 StorageAndroid App Development - 09 Storage
Android App Development - 09 Storage
 
Android-data storage in android-chapter21
Android-data storage in android-chapter21Android-data storage in android-chapter21
Android-data storage in android-chapter21
 
Android Storage - Vold
Android Storage - VoldAndroid Storage - Vold
Android Storage - Vold
 
Storage 8
Storage   8Storage   8
Storage 8
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
 
Local Storage
Local StorageLocal Storage
Local Storage
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Building node.js applications with Database Jones
Building node.js applications with Database JonesBuilding node.js applications with Database Jones
Building node.js applications with Database Jones
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and Storage
 
03 programmation mobile - android - (stockage, multithreads, web services)
03 programmation mobile - android - (stockage, multithreads, web services)03 programmation mobile - android - (stockage, multithreads, web services)
03 programmation mobile - android - (stockage, multithreads, web services)
 
Kp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan userKp.3 pengaturan sistem dan user
Kp.3 pengaturan sistem dan user
 
REST Basics
REST BasicsREST Basics
REST Basics
 
香港六合彩
香港六合彩香港六合彩
香港六合彩
 
My sql tutorial-oscon-2012
My sql tutorial-oscon-2012My sql tutorial-oscon-2012
My sql tutorial-oscon-2012
 
Keras CNN Pre-trained Deep Learning models for Flower Recognition
Keras CNN Pre-trained Deep Learning models for Flower RecognitionKeras CNN Pre-trained Deep Learning models for Flower Recognition
Keras CNN Pre-trained Deep Learning models for Flower Recognition
 
Data management
Data managementData management
Data management
 
Data management
Data managementData management
Data management
 

Viewers also liked

Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBBWilliam Lee
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System ServerOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and DevelopmentOpersys inc.
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in AndroidOpersys inc.
 
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)William Lee
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesOpersys inc.
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesWilliam Lee
 
Beginning android application development wei meng lee
Beginning android application development wei meng leeBeginning android application development wei meng lee
Beginning android application development wei meng leeHiệp Lê Quang
 
Basic Computer Course in Ambala ! Batra Computer Centre
Basic Computer Course in Ambala ! Batra Computer CentreBasic Computer Course in Ambala ! Batra Computer Centre
Basic Computer Course in Ambala ! Batra Computer Centrejatin batra
 
C++ Training Institute in Ambala ! Batra Computer Centre
C++ Training Institute in Ambala ! Batra Computer CentreC++ Training Institute in Ambala ! Batra Computer Centre
C++ Training Institute in Ambala ! Batra Computer Centrejatin batra
 
SQL Training Centre in Ambala ! Batra Computer Centre
SQL Training Centre in Ambala ! Batra Computer CentreSQL Training Centre in Ambala ! Batra Computer Centre
SQL Training Centre in Ambala ! Batra Computer Centrejatin batra
 
HTML Training Centre in Ambala ! Batra Computer Cetre
HTML Training Centre in Ambala ! Batra Computer CetreHTML Training Centre in Ambala ! Batra Computer Cetre
HTML Training Centre in Ambala ! Batra Computer Cetrejatin batra
 
Android GDB Debugging (Chinese)
Android GDB Debugging (Chinese)Android GDB Debugging (Chinese)
Android GDB Debugging (Chinese)William Lee
 
Android Services and Managers Basic
Android Services and Managers BasicAndroid Services and Managers Basic
Android Services and Managers BasicWilliam Lee
 
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeGNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeWilliam Lee
 
Android Debugging (Chinese)
Android Debugging (Chinese)Android Debugging (Chinese)
Android Debugging (Chinese)William Lee
 

Viewers also liked (20)

Android Storage - StorageManager & OBB
Android Storage - StorageManager & OBBAndroid Storage - StorageManager & OBB
Android Storage - StorageManager & OBB
 
Understanding the Android System Server
Understanding the Android System ServerUnderstanding the Android System Server
Understanding the Android System Server
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
Android Platform Debugging and Development
Android Platform Debugging and DevelopmentAndroid Platform Debugging and Development
Android Platform Debugging and Development
 
MGCP Overview
MGCP OverviewMGCP Overview
MGCP Overview
 
Memory Management in Android
Memory Management in AndroidMemory Management in Android
Memory Management in Android
 
Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)Introduction to SIP(Session Initiation Protocol)
Introduction to SIP(Session Initiation Protocol)
 
MTP & PTP
MTP & PTPMTP & PTP
MTP & PTP
 
Android Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and ResourcesAndroid Variants, Hacks, Tricks and Resources
Android Variants, Hacks, Tricks and Resources
 
Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
Beginning android application development wei meng lee
Beginning android application development wei meng leeBeginning android application development wei meng lee
Beginning android application development wei meng lee
 
Basic Computer Course in Ambala ! Batra Computer Centre
Basic Computer Course in Ambala ! Batra Computer CentreBasic Computer Course in Ambala ! Batra Computer Centre
Basic Computer Course in Ambala ! Batra Computer Centre
 
C++ Training Institute in Ambala ! Batra Computer Centre
C++ Training Institute in Ambala ! Batra Computer CentreC++ Training Institute in Ambala ! Batra Computer Centre
C++ Training Institute in Ambala ! Batra Computer Centre
 
SQL Training Centre in Ambala ! Batra Computer Centre
SQL Training Centre in Ambala ! Batra Computer CentreSQL Training Centre in Ambala ! Batra Computer Centre
SQL Training Centre in Ambala ! Batra Computer Centre
 
HTML Training Centre in Ambala ! Batra Computer Cetre
HTML Training Centre in Ambala ! Batra Computer CetreHTML Training Centre in Ambala ! Batra Computer Cetre
HTML Training Centre in Ambala ! Batra Computer Cetre
 
Android GDB Debugging (Chinese)
Android GDB Debugging (Chinese)Android GDB Debugging (Chinese)
Android GDB Debugging (Chinese)
 
Android Services and Managers Basic
Android Services and Managers BasicAndroid Services and Managers Basic
Android Services and Managers Basic
 
GNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in GnomeGNOME GeoClue - The Geolocation Service in Gnome
GNOME GeoClue - The Geolocation Service in Gnome
 
Android Debugging (Chinese)
Android Debugging (Chinese)Android Debugging (Chinese)
Android Debugging (Chinese)
 

Similar to Android Storage - Internal and External Storages

Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Khaled Anaqwa
 
10g rac asm
10g rac asm10g rac asm
10g rac asmVictor
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageOliver Scheer
 
03 android application structure
03 android application structure03 android application structure
03 android application structureSokngim Sa
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationWilliam Lee
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversRajKumar Rampelli
 
Cheat sheet soa_essentials
Cheat sheet soa_essentialsCheat sheet soa_essentials
Cheat sheet soa_essentialsxavier john
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldTarunsingh198
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3Ben Abdallah Helmi
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension developmentvicccuu
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3Ben Abdallah Helmi
 
Vista Forensics
Vista ForensicsVista Forensics
Vista ForensicsCTIN
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4than sare
 
Mobile Application Development-Lecture 13 & 14.pdf
Mobile Application Development-Lecture 13 & 14.pdfMobile Application Development-Lecture 13 & 14.pdf
Mobile Application Development-Lecture 13 & 14.pdfAbdullahMunir32
 

Similar to Android Storage - Internal and External Storages (20)

Android - Saving data
Android - Saving dataAndroid - Saving data
Android - Saving data
 
Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)Android Training (Storing & Shared Preferences)
Android Training (Storing & Shared Preferences)
 
10g rac asm
10g rac asm10g rac asm
10g rac asm
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Windows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and StorageWindows Phone 8 - 4 Files and Storage
Windows Phone 8 - 4 Files and Storage
 
03 android application structure
03 android application structure03 android application structure
03 android application structure
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
Level 4
Level 4Level 4
Level 4
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
EndPoint Vault (Demo Walkthrough)
EndPoint Vault (Demo Walkthrough)EndPoint Vault (Demo Walkthrough)
EndPoint Vault (Demo Walkthrough)
 
Cheat sheet soa_essentials
Cheat sheet soa_essentialsCheat sheet soa_essentials
Cheat sheet soa_essentials
 
Synapseindia android apps introduction hello world
Synapseindia android apps introduction hello worldSynapseindia android apps introduction hello world
Synapseindia android apps introduction hello world
 
SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3SCWCD : Servlet web applications : CHAP : 3
SCWCD : Servlet web applications : CHAP : 3
 
Cliw - extension development
Cliw -  extension developmentCliw -  extension development
Cliw - extension development
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Aties Presentation
Aties PresentationAties Presentation
Aties Presentation
 
Vista Forensics
Vista ForensicsVista Forensics
Vista Forensics
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4
 
Mobile Application Development-Lecture 13 & 14.pdf
Mobile Application Development-Lecture 13 & 14.pdfMobile Application Development-Lecture 13 & 14.pdf
Mobile Application Development-Lecture 13 & 14.pdf
 

More from William Lee

Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxWilliam Lee
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHPWilliam Lee
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 William Lee
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3William Lee
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)William Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerWilliam Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCapWilliam Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding WindowWilliam Lee
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserWilliam Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserWilliam Lee
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASPWilliam Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginWilliam Lee
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5William Lee
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)William Lee
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web PageWilliam Lee
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 UsageWilliam Lee
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)William Lee
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OSWilliam Lee
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069William Lee
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)William Lee
 

More from William Lee (20)

Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASP
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
 
Study of Chromium OS
Study of Chromium OSStudy of Chromium OS
Study of Chromium OS
 
Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069Introdunction To Network Management Protocols SNMP & TR-069
Introdunction To Network Management Protocols SNMP & TR-069
 
More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)More Details about TR-069 (CPE WAN Management Protocol)
More Details about TR-069 (CPE WAN Management Protocol)
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Android Storage - Internal and External Storages

  • 1. Android Storage - Internal & External Storages (Honeycomb 3.2) William.L wiliwe@gmail.com 2011-09-10
  • 2. Outline Storage Configuration File Internal Storage Configuration External Storage Configuration Storage Settings
  • 3. Storage Configuration File (1/2) Since Android Honeycomb 3.0 , it uses a configuration file to control which volume should be mounted. Storage Configuration File Honeycomb 3.0 : /device/SoCVendorName/SoCModelName/overlay/fram eworks/base/core/res/res/values/config.xml Honeycomb 3.2 : /device/SoCVendorName/SoCModelName/overlay/fram eworks/base/core/res/res/xml/storage_list.xml
  • 4. Storage Configuration File (2/2) When MoutService initializes, it reads and parses storage configuration file and stores information from storage configuration file into a variable of StorageVolume type MountService.MountService() MountService.readStorageList() Storage Configuration File call read
  • 5. Internal Storage Configuration (1/2) Since Android Honeycomb 3.0 , the internal storage is formed by remapping /data/media to /sdcard through FUSE for MTP usage. Following steps are for volume mounting : Mount /dev/block/mmcblk0p3(the actual partition is depending on your device) to /data, descripted in init.rc mkdir /sdcard, /data/media Remap /data/media to /sdcard in FUSE using the tool /system/bin/sdcard (source code is /system/core/sdcard) utility in init.ventana.rc Export ”EXTERNAL_STORAGE“ environmental variable with value “/sdcard” MountService bind /sdcard to MtpService in Java layer
  • 6. Internal Storage Configuration (2/2) In storge configuration file, the configuration for Internal Storage could be: <StorageList xmlns:android="http://schemas.android.com/apk/res/android"> <storage android:mountPoint="/mnt/sdcard" android:storageDescription="@string/storage_internal" android:primary="true" android:emulated="true" android:mtpReserve="100" /> </StorageList> The string variable after “@string/” could be found in /frameworks/base/core/res/res/values/strings.xml
  • 7. External Storage Configuration (1/2) In storge configuration file, the configuration for SD card could be: <StorageList xmlns:android="http://schemas.android.com/apk/res/android"> <storage android:mountPoint="/mnt/sdcard2" android:storageDescription="@string/storage_sd_card" android:removable="true" /> </StorageList> The string variable after “@string/” could be found in /frameworks/base/core/res/res/values/strings.xml
  • 8. External Storage Configuration (2/2) In storge configuration file, the configuration for USB stick(thumbdrive) could be: <StorageList xmlns:android="http://schemas.android.com/apk/res/android"> <storage android:mountPoint="/mnt/usbdrive" android:storageDescription="@string/storage_usb" android:removable="true" /> </StorageList> The string variable after “@string/” could be found in /frameworks/base/core/res/res/values/strings.xml
  • 9. Storage Settings (1/5) The "Storage" settings form(layout) /packages/apps/Settings/res/xml/device_info_memory. xml UI strings like "Available space", "Total space" values are defined in /packages/apps/Settings/res/values/strings.xml
  • 10. Storage Settings (2/5) /packages/apps/Settings/src/com/android/settings/ deviceinfo/Memory.java Use StorageManager to get MountService instance and the number of storages in the system. There has a BroadcastReceiver, MediaScannerReceiver, that receives ACTION_MEDIA_SCANNER_STARTED intent when a storage plugging into the device. Register a storage listener (of IMountService) implementing onStorageStateChanged() interface which is called by MountService's method updatePublicVolumeState().
  • 11. Storage Settings (3/5) /packages/apps/Settings/src/com/android/settings/ deviceinfo/Memory.java When MoutService initializes, it parses storage_list.xml and stores information likes the amount of storages in the system, mount-point, removable or not, storage name in a variable typed in StorageVolume. These storage information will be stored in an array in type of StorageVolumePreferenceCategory when onCreate() is run. The sequence to put the information into the array (StorageVolumePreferenceCategory type) determines the showing sequence in storage settings.
  • 12. Storage Settings (4/5) /packages/apps/Settings/src/com/android/settings/ deviceinfo/Memory.java Finally, using StorageVolumePreferenceCategory.init() to create storage usage statics diagram。 P.S : this class process click event of Preference in the method onPreferenceTreeClick()
  • 13. Storage Settings (5/5) /packages/apps/Settings/src/com/android/settings/ deviceinfo/StorageVolumePreferenceCatagory.java In method getInstance(), it uses StorageMeasurement class to recored the usage of each storage volume. Using Map data structure to record StorageVolume and StorageMeasurement pair. Each StorageVolume object correspond to a StorageVolumePreferenceCategory object; each StorageVolumePreferenceCategory object has a StorageMeasurement object.