Storage Options Android provides several options for you to save persistent application data. The solution you choose depends on your specific needs, such as whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires. Your data storage options are the following: 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. Network Connection Store data on the web with your own network server. Android provides a way for you to expose even your private data to other applications — with a content provider. Using Shared Preferences The SharedPreferences class provides a general framework that allows you to save and retrieve persistent key-value pairs of primitive data types. User Preferences To write values: // Commit the edits! For example:
VideoView Class Overview Displays a video file. The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting. Summary Public Constructors Public Methods public void addSubtitleSource (InputStream is, MediaFormat format) Parameters public boolean canPause () public boolean canSeekBackward () public boolean canSeekForward () public void draw (Canvas canvas) public int getAudioSessionId () Get the audio session id for the player used by this VideoView. Returns The audio session, or 0 if there was an error. public int getBufferPercentage () public int getCurrentPosition () public int getDuration () public boolean isPlaying () public void onInitializeAccessibilityEvent (AccessibilityEvent event) Initializes an AccessibilityEvent with information about this View which is the event source. public void seekTo (int msec)
android - Iterate through rows from Sqlite-query Tutos Android - Tutoriels pour développer des applications Android Comment utiliser SQLite sous Android [Tutoriel Android n°19] | Tuto Mobile Après une grosse période de coupure, me revoilà avec de nouveaux tutos. Celui d’aujourd’hui concerne SQLite sous Android. C’est toujours utile de pouvoir stocker quelques données dans une application. Les tables que l’on créé avec SQLite doivent bien entendu être simple tout comme les requêtes que vous ferez dessus. Pour notre exemple, nous allons créer une mini base de données pour enregistrer des livres. SQLiteOpenHelper qui est une classe d’assistance pour gérer la création de bases de données et la gestion des versions.ContentValue, cette classe est utilisée pour stocker un ensemble de valeurs que le ContentResolver peut traiter.Cursor est une interface qui donne accès en lecture-écriture à l’ensemble des résultats retournés par une requête de base de données. On va donc commencer doucement avec la création de la classe Livre (très simple pour notre exemple). Code Java Ensuite nous allons créer une nouvelle classe (rassurez-vous, c’est la dernière) que j’ai appelée LivresBDD.
local storage - Overriding default functions in Javascript android - Phonegap get localstorage values from Java code Using your own SQLite database in Android applications | ReignDesign Most all of the Android examples and tutorials out there assume you want to create and populate your database at runtime and not to use and access an independent, preloaded database with your Android application. The method I'm going to show you takes your own SQLite database file from the "assets" folder and copies into the system database path of your application so the SQLiteDatabase API can open and access it normally. 1. Assuming you already have your sqlite database created, we need to do some modifications to it. Open your database and add a new table called "android_metadata", you can execute the following SQL statement to do it: CREATE TABLE "android_metadata" ("locale" TEXT DEFAULT 'en_US') Now insert a single row with the text 'en_US' in the "android_metadata" table: INSERT INTO "android_metadata" VALUES ('en_US') Then, it is necessary to rename the primary id field of your tables to "_id" so Android will know where to bind the id field of your tables. 2. That's it. ...
Android Application Development: Playing with SQLite Database In this article, I will focus on building an Android app using an SQLite database; I assume readers are familiar with the basics of database operations and concepts. Here, we will also be using some threaded programming in Java, so I’m assuming readers are familiar with this concept. The SQLite database is used in Android for storing and managing application data. In this article, I will develop a simple log-in application, which stores user details in the database, and performs basic DDL (Data Definition Language, e.g., creation of tables, etc); DML (Data Manipulation Language, e.g., insert, delete, etc) transactions on the database. Let’s get started with the design of the application (see Figures 1 and 2). Figure 1: Design of our simple login application Figure 2: Table design We will create a database that holds the credentials of all the users. User login: Whenever someone tries to log in to the application, we query the credentials entered by that person against our database.