Android Development - Snippets

Aus Wikizone
Wechseln zu: Navigation, Suche

Activities

Android - Neue Activity anlegen und starten

Android - Neue Activity

Layouts

Lock Portrait or Landscape fullscreen - requestwindowfeature

Views

Vertical Seek Bar

Android - Vertical Seek Bar

Events

Android - OnClickListener

Graphic and Animation

Bitmap - ressource und input stream


Sprites

Sound

Unterstützte Formate

Links

Möglichkeiten zur Sound-Ausgabe

SoundPool

MediaPlayer

Android - Media Player

http://developer.android.com/reference/android/media/MediaPlayer.html

Generate Sound (Midi-Files + PCM Generation mit AudioTrack) Android - rttl Sound File

System Sounds

Fortgeschrittene Techniken

Threads

Files, Dateimanagment

Android - Dateimanagement

Textdatei erzeugen, speichern, lesen

Bild erzeugen und speichern

http://stackoverflow.com/questions/10278919/android-writing-reading-picture-to-internal-storage?rq=1

Android - Bild erzeugen und speichern

Zugriff auf Ressourcen

Beispiel Speicherkarte:

File.DirRootExternal & "/Music", "titelx.mp3"


Ressourcen Pfad herausfinden

Ist das richtig ??? Eigentlich muß die Ressource ID in den Filenamen umgewandelt werden.

Using Resource Name

Syntax:

android.resource://[package]/[res type]/[res name]

Example : If icon.png image file is available in res/drawable folder you can get path like :

String PATH="android.resource://com.my.package/drawable/icon";

Using Resource Id

Syntax :

android.resource://[package]/[resource_id]

Example : If icon.png image file is available in res/drawable folder you can get path:

String PATH="android.resource://com.my.package/" + R.drawable.icon;

This were the examples to get the URI of any image file stored in drawable folder.

Similarly you can get URIs of res/raw folder also.


???