SlideShare a Scribd company logo
Android
mobilių programėlių kūrimo įvadas
Storage Options
Android provides several options for you to save
persistent application data.

Shared Preferences - Store private primitive
data in key-value pairs.

Internal Storage - Store private data on the
device memory.

External Storage - Store public data on the
shared external storage.

SQLite Databases - Store structured data in a
private database.
SharedPreferences   - getSharedPreferences() - Use this if you need
                    multiple preferences files identified by name,
                    which you specify with the first parameter.

                    - getPreferences() - Use this if you need only
                    one preferences file for your Activity.

                    To read values, use SharedPreferences
                    methods such as getBoolean() and getString().

                    To write values:
                    1. Call edit() to get a SharedPreferences.Editor.
                    2. Add values with methods such as putString().
                    3. Commit the new values with commit()
Internal Storage   To create and write a private file to the internal
                   storage:

                   1. Call openFileOutput() with the name of the file
                   and the operating mode. This returns a
                   FileOutputStream.

                   2. Write to the file with write().

                   3. Close the stream with close().
External Storage   If you're using API Level 7 or lower, use
                   getExternalStorageDirectory() to open a File that represents the
                   root of the external storage, then save your shared files in one of
                   the following directories:

                   Music/ - Media scanner classifies all media found here as user
                   music.
                   Podcasts/ - Media scanner classifies all media found here as a
                   podcast.
                   Ringtones/ - Media scanner classifies all media found here as a
                   ringtone.
                   Alarms/ - Media scanner classifies all media found here as an
                   alarm sound.
                   Notifications/ - Media scanner classifies all media found here as
                   a notification sound.
                   Pictures/ - All photos (excluding those taken with the camera).
                   Movies/ - All movies (excluding those taken with the camcorder).
                   Download/ - Miscellaneous downloads.
Databases   Android provides full support for SQLite
            databases. Any databases you create will be
            accessible by name to any class in the
            application, but not outside the application.

            The recommended method to create a new
            SQLite database is to create a subclass of
            SQLiteOpenHelper and override the onCreate()
            method, in which you can execute a SQLite
            command to create tables in the database.
Databases   You can then get an instance of your
            SQLiteOpenHelper implementation using the
            constructor you've defined. To write to and
            read from the database, call
            getWritableDatabase() and
            getReadableDatabase(), respectively.

            These both return a SQLiteDatabase object
            that represents the database and provides
            methods for SQLite operations.
GPS   GPS_PROVIDER
      This provider determines location using satellites.
      Depending on conditions, this provider may take
      a while to return a location fix.

      NETWORK_PROVIDER
      This provider determines location based on
      availability of cell tower and WiFi access points.
      Results are retrieved by means of a network
      lookup.

      PASSIVE_PROVIDER
      A special location provider for receiving locations
      without actually initiating a location fix.
Google Maps

              The Google Maps Android API v2 uses a new
              system of managing keys. Existing keys from a
              Google Maps Android v1 application, commonly
              known as MapView, will not work with the v2 API.

              To access the Google Maps servers with the
              Maps API, you have to add a Maps API key to
              your application. The key is free, you can use it
              with any of your applications that call the Maps
              API, and it supports an unlimited number of
              users.
Google Maps
              An Android application that uses the Google
              Maps Android API needs to specify the
              following settings in its manifest file,
              AndroidManifest.xml:

              Permissions that give the application access
              to Android system features and to the
              Google Maps servers.

              Notification that the application requires
              OpenGL ES version 2.

              The Maps API key for the application. The
              key confirms that you've registered with the
              Google Maps service via the Google APIs
              Console.
Camera
Q&A
v.valkaitis@appcamp.lt

More Related Content

PPTX
Databases in Android Application
Mark Lester Navarro
 
PPTX
Android Database Tutorial
Perfect APK
 
PDF
Lab 5-Android
Lilia Sfaxi
 
PPT
android content providers
Deepa Rani
 
PDF
Lab2-android
Lilia Sfaxi
 
DOCX
Android database tutorial
info_zybotech
 
PPT
Unit i informatica en ingles
Marisa Torrecillas
 
DOCX
ANDROID USING SQLITE DATABASE ADMINISTRATORS ~HMFTJ
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 
Databases in Android Application
Mark Lester Navarro
 
Android Database Tutorial
Perfect APK
 
Lab 5-Android
Lilia Sfaxi
 
android content providers
Deepa Rani
 
Lab2-android
Lilia Sfaxi
 
Android database tutorial
info_zybotech
 
Unit i informatica en ingles
Marisa Torrecillas
 
ANDROID USING SQLITE DATABASE ADMINISTRATORS ~HMFTJ
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
 

Viewers also liked (16)

PPTX
Latihan powerpoint1 bambang aji nagan
Bambang Nagan
 
PDF
027665
jeanmor
 
PPTX
Glándulas sudoríparas
Benito Guadalupe Becerra Dueñas
 
PPT
2 sist. pencernaan biologi
Bambang Nagan
 
PDF
App Camp 2014 Final Pitches
Tadas Jurelevičius
 
PPT
Philadelphia
jordmac
 
PDF
The Globalist (Special Issue)
Rosemarie Antonio
 
PDF
GML January - June 2013 (Governor's Monthly Letter)
Rosemarie Antonio
 
PDF
Fusao nuclearpt
Gonçalo Figueira
 
PPT
Presentation1
jordmac
 
PPT
"Android" mobilių programėlių kūrimo įvadas
Tadas Jurelevičius
 
PPTX
Latihan powerpoint1 bambang aji nagan
Bambang Nagan
 
PPT
All about dinosaurs 1
jordmac
 
PPT
John adams quincy
jordmac
 
PPTX
INGLÊS 10º ANO: STUDYING ABROAD
Daniel Sousa
 
PPTX
Daño axonal difuso
drfrankmartinez
 
Latihan powerpoint1 bambang aji nagan
Bambang Nagan
 
027665
jeanmor
 
Glándulas sudoríparas
Benito Guadalupe Becerra Dueñas
 
2 sist. pencernaan biologi
Bambang Nagan
 
App Camp 2014 Final Pitches
Tadas Jurelevičius
 
Philadelphia
jordmac
 
The Globalist (Special Issue)
Rosemarie Antonio
 
GML January - June 2013 (Governor's Monthly Letter)
Rosemarie Antonio
 
Fusao nuclearpt
Gonçalo Figueira
 
Presentation1
jordmac
 
"Android" mobilių programėlių kūrimo įvadas
Tadas Jurelevičius
 
Latihan powerpoint1 bambang aji nagan
Bambang Nagan
 
All about dinosaurs 1
jordmac
 
John adams quincy
jordmac
 
INGLÊS 10º ANO: STUDYING ABROAD
Daniel Sousa
 
Daño axonal difuso
drfrankmartinez
 
Ad

Similar to "Android" mobilių programėlių kūrimo įvadas #3 (20)

PPTX
Mobile application Development-UNIT-V (1).pptx
JayasimhaThummala1
 
PPT
Android booting sequece and setup and debugging
Utkarsh Mankad
 
PPTX
Android session 4-behestee
Hussain Behestee
 
DOCX
Android-data storage in android-chapter21
Dr. Ramkumar Lakshminarayanan
 
PPT
Android In A Nutshell
Ted Chien
 
ODP
Intro To Android App Development
Mike Kvintus
 
PDF
Mobile Application Development-Lecture 13 & 14.pdf
AbdullahMunir32
 
PPTX
UNIT5newpart1pptx__2024_11_13_09_51_59 (1).pptx
LeeroyMugadza
 
PPT
Android programming
vijay_uttam
 
PPT
Android Anatomy
Bhavya Siddappa
 
PPTX
Android cours
zakaria bentahar
 
PPTX
2.Android Platform_Theory.pptx
Nizarnizarsurche
 
PDF
Accessing Hardware on Android
Gary Bisson
 
PPT
Cognos Software Development Kit
Sandeep Sharma IIMK Smart City,IoT,Bigdata,Cloud,BI,DW
 
PPTX
12_Data_Storage_Part_2.pptx
FaezNasir
 
PPTX
Aptech Apps
RasikaShinde6
 
PPT
Synapseindia android application development tutorial
Synapseindiappsdevelopment
 
PPT
Synapseindia android apps development tutorial
Synapseindiappsdevelopment
 
PPT
Data Storage In Android
Aakash Ugale
 
PPTX
Android development classes in chandigarh : Big Boxx Academy
Big Boxx Animation Academy
 
Mobile application Development-UNIT-V (1).pptx
JayasimhaThummala1
 
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Android session 4-behestee
Hussain Behestee
 
Android-data storage in android-chapter21
Dr. Ramkumar Lakshminarayanan
 
Android In A Nutshell
Ted Chien
 
Intro To Android App Development
Mike Kvintus
 
Mobile Application Development-Lecture 13 & 14.pdf
AbdullahMunir32
 
UNIT5newpart1pptx__2024_11_13_09_51_59 (1).pptx
LeeroyMugadza
 
Android programming
vijay_uttam
 
Android Anatomy
Bhavya Siddappa
 
Android cours
zakaria bentahar
 
2.Android Platform_Theory.pptx
Nizarnizarsurche
 
Accessing Hardware on Android
Gary Bisson
 
12_Data_Storage_Part_2.pptx
FaezNasir
 
Aptech Apps
RasikaShinde6
 
Synapseindia android application development tutorial
Synapseindiappsdevelopment
 
Synapseindia android apps development tutorial
Synapseindiappsdevelopment
 
Data Storage In Android
Aakash Ugale
 
Android development classes in chandigarh : Big Boxx Academy
Big Boxx Animation Academy
 
Ad

Recently uploaded (20)

PPTX
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
PPTX
CDH. pptx
AneetaSharma15
 
PDF
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
PPTX
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
PPTX
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
PPTX
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
DOCX
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
DOCX
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
PPTX
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
PPTX
How to Apply for a Job From Odoo 18 Website
Celine George
 
PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PPTX
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 
BASICS IN COMPUTER APPLICATIONS - UNIT I
suganthim28
 
CDH. pptx
AneetaSharma15
 
Biological Classification Class 11th NCERT CBSE NEET.pdf
NehaRohtagi1
 
Five Point Someone – Chetan Bhagat | Book Summary & Analysis by Bhupesh Kushwaha
Bhupesh Kushwaha
 
Applications of matrices In Real Life_20250724_091307_0000.pptx
gehlotkrish03
 
HISTORY COLLECTION FOR PSYCHIATRIC PATIENTS.pptx
PoojaSen20
 
Unit 5: Speech-language and swallowing disorders
JELLA VISHNU DURGA PRASAD
 
Modul Ajar Deep Learning Bahasa Inggris Kelas 11 Terbaru 2025
wahyurestu63
 
How to Track Skills & Contracts Using Odoo 18 Employee
Celine George
 
How to Apply for a Job From Odoo 18 Website
Celine George
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
Sonnet 130_ My Mistress’ Eyes Are Nothing Like the Sun By William Shakespear...
DhatriParmar
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Command Palatte in Odoo 18.1 Spreadsheet - Odoo Slides
Celine George
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Artificial Intelligence in Gastroentrology: Advancements and Future Presprec...
AyanHossain
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Tips Management in Odoo 18 POS - Odoo Slides
Celine George
 

"Android" mobilių programėlių kūrimo įvadas #3

  • 2. Storage Options Android provides several options for you to save persistent application data. Shared Preferences - Store private primitive data in key-value pairs. Internal Storage - Store private data on the device memory. External Storage - Store public data on the shared external storage. SQLite Databases - Store structured data in a private database.
  • 3. SharedPreferences - getSharedPreferences() - Use this if you need multiple preferences files identified by name, which you specify with the first parameter. - getPreferences() - Use this if you need only one preferences file for your Activity. To read values, use SharedPreferences methods such as getBoolean() and getString(). To write values: 1. Call edit() to get a SharedPreferences.Editor. 2. Add values with methods such as putString(). 3. Commit the new values with commit()
  • 4. Internal Storage To create and write a private file to the internal storage: 1. Call openFileOutput() with the name of the file and the operating mode. This returns a FileOutputStream. 2. Write to the file with write(). 3. Close the stream with close().
  • 5. External Storage If you're using API Level 7 or lower, use getExternalStorageDirectory() to open a File that represents the root of the external storage, then save your shared files in one of the following directories: Music/ - Media scanner classifies all media found here as user music. Podcasts/ - Media scanner classifies all media found here as a podcast. Ringtones/ - Media scanner classifies all media found here as a ringtone. Alarms/ - Media scanner classifies all media found here as an alarm sound. Notifications/ - Media scanner classifies all media found here as a notification sound. Pictures/ - All photos (excluding those taken with the camera). Movies/ - All movies (excluding those taken with the camcorder). Download/ - Miscellaneous downloads.
  • 6. Databases Android provides full support for SQLite databases. Any databases you create will be accessible by name to any class in the application, but not outside the application. The recommended method to create a new SQLite database is to create a subclass of SQLiteOpenHelper and override the onCreate() method, in which you can execute a SQLite command to create tables in the database.
  • 7. Databases You can then get an instance of your SQLiteOpenHelper implementation using the constructor you've defined. To write to and read from the database, call getWritableDatabase() and getReadableDatabase(), respectively. These both return a SQLiteDatabase object that represents the database and provides methods for SQLite operations.
  • 8. GPS GPS_PROVIDER This provider determines location using satellites. Depending on conditions, this provider may take a while to return a location fix. NETWORK_PROVIDER This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup. PASSIVE_PROVIDER A special location provider for receiving locations without actually initiating a location fix.
  • 9. Google Maps The Google Maps Android API v2 uses a new system of managing keys. Existing keys from a Google Maps Android v1 application, commonly known as MapView, will not work with the v2 API. To access the Google Maps servers with the Maps API, you have to add a Maps API key to your application. The key is free, you can use it with any of your applications that call the Maps API, and it supports an unlimited number of users.
  • 10. Google Maps An Android application that uses the Google Maps Android API needs to specify the following settings in its manifest file, AndroidManifest.xml: Permissions that give the application access to Android system features and to the Google Maps servers. Notification that the application requires OpenGL ES version 2. The Maps API key for the application. The key confirms that you've registered with the Google Maps service via the Google APIs Console.