Sunday, August 29, 2010

Custom Adapter with a Listview

http://developerlife.com/tutorials/?p=327

API demos notes

1. SharedPreferences : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/PersistentState.html
http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/RedirectEnter.html - follow the classes in the source for advanced SharedPreferences ops.
eg: preferences.edit().remove("text").commit();

2. TextView.BufferType.EDITABLE - This allows us to later extend the text buffer : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/ReceiveResult.html

3. Example of removing yourself from the history stack after forwarding to another activity(just call finish) : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/Forwarding.html

4. Translucent activity - android:theme="@style/Theme.Transparent" in the activity declaration in manifest : http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/TranslucentActivity.html

5. Translucent+BLUR background -

    // Have the system blur any windows behind this one.
       getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND,
       WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
Also in manifest - android:theme="@style/Theme.Transparent"> :  http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/TranslucentBlurActivity.html

6. Services : later

7.

Monday, August 9, 2010

Android error: "audiorecord Could not get audio input for record source 1"

http://comments.gmane.org/gmane.comp.handhelds.android.devel/84064 - says: "I was trying to start recording
from 2 separate threads at the same time causing a conflict."

http://langtagsandroid.langtags.com/blog/?p=605 -  says: Everytime you get an error instantiating AudioRecord it doesn´t release it´s resources the way it should so you won´t be able to request it again unless you restart your phone (or close and reopen
the emulator).
This solution (restarting emulator) worked for me

Android AudioTrack-AudioRecord native API usage and recommendations

http://markmail.org/message/ikt3yvfag6pfr342#query:android%20audiotrack%20native%20api+page:1+mid:ikt3yvfag6pfr342+state:results

Sunday, August 8, 2010

Android: Horizontal Progress Bar

<ProgressBar
android:id="@+id/ProgressBar01"
android:layout_height="wrap_content"
android:layout_width="250px"
style="?android:attr/progressBarStyleHorizontal">
</ProgressBar>