[android-developers] Immediate Opening for Android Developer @ CA

2019-09-17 Thread Anand KK


Hi Friends ,


Please find the Job Description and Kindly share your Resume - 
aa...@sakintech.com


Location : San Francisco,CA.


We are looking for an Android Developer with Java Background who possesses 
a passion for pushing mobile technologies to the limits. This Android app 
developer will work with our team of talented engineers to design and build 
the next generation of our mobile applications. Android programming works 
closely with other app development and technical teams.

Responsibilities

Design and build advanced applications for the Android platform
Collaborate with cross-functional teams to define, design, and ship new 
features
Work with outside data sources and APIs


Regards,

Aadil Ahmed 

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/02e767da-e1ba-4fc8-b865-e4190b9c60e5%40googlegroups.com.


[android-developers] Android Pinch zoom not working over imageview inside gesture overlayview

2014-04-17 Thread KK
I am doing the following in my application.

1) Display a image in a activity.

2) Recognize gesture over that image.

3) And also doing pinch and zoom over the same image.

The layout I have created is given below.

**
*http://schemas.android.com/apk/res/android"*
*android:layout_width="fill_parent"*
*android:layout_height="fill_parent" >*

**
**

**

And I am using the following code for the "pinch zoom" and "gesture 
overlayview" (detect the gesture).

*public class Touch extends Activity implements OnTouchListener {*
*private static final String TAG = "Touch";*

* // These matrices will be used to move and zoom image*
* Matrix matrix = new Matrix();*
* Matrix savedMatrix = new Matrix();*

* // We can be in one of these 3 states*
* static final int NONE = 0;*
* static final int DRAG = 1;*
* static final int ZOOM = 2;*
* int mode = NONE;*

* // Remember some things for zooming*
* PointF start = new PointF();*
* PointF mid = new PointF();*
* float oldDist = 1f;*

* @Override*
* public void onCreate(Bundle savedInstanceState) {*
* super.onCreate(savedInstanceState);*
* GestureOverlayView gestureOverlayView = new GestureOverlayView(this);*
* View inflate = getLayoutInflater().inflate(R.layout.main, null);*
* gestureOverlayView.addView(inflate);*

* ImageView img = (ImageView) inflate.findViewById(R.id.showImg);*
* img.setScaleType(ImageView.ScaleType.FIT_CENTER);*
* img.setOnTouchListener(this);*

* setContentView(gestureOverlayView);*
* }*

* public boolean onTouch(View v, MotionEvent event) {*
* ImageView view = (ImageView) v;*
* view.setScaleType(ImageView.ScaleType.MATRIX);*
* float scale;*

* // Dump touch event to log*
* dumpEvent(event);*

* // Handle touch events here...*
* switch (event.getAction() & MotionEvent.ACTION_MASK) {*

* case MotionEvent.ACTION_DOWN: // first finger down only *
* Log.d(TAG, "mode=DRAG");*
* mode = DRAG;*
* break;*
* case MotionEvent.ACTION_UP: // first finger lifted*
* case MotionEvent.ACTION_POINTER_UP: // second finger lifted*
* mode = NONE;*
* Log.d(TAG, "mode=NONE");*
* break;*
* case MotionEvent.ACTION_POINTER_DOWN: // second finger down*
* oldDist = spacing(event);*
* Log.d(TAG, "oldDist=" + oldDist);*
* if (oldDist > 5f) {*
* savedMatrix.set(matrix);*
* midPoint(mid, event);*
* mode = ZOOM;*
* Log.d(TAG, "mode=ZOOM");*
* }*
* break;*

* case MotionEvent.ACTION_MOVE:*
* if (mode == DRAG) { // movement of first finger*
* } else if (mode == ZOOM) { // pinch zooming*
* float newDist = spacing(event);*
* Log.d(TAG, "newDist=" + newDist);*
* if (newDist > 5f) {*
* matrix.set(savedMatrix);*
* scale = newDist / oldDist; // thinking i need to play around*
* // with this value to limit it*
* matrix.postScale(scale, scale, mid.x, mid.y);*
* }*
* }*
* break;*
* }*

* // Perform the transformation*
* view.setImageMatrix(matrix);*

* return true; // indicate event was handled*
* }*

* private float spacing(MotionEvent event) {*
* float x = event.getX(0) - event.getX(1);*
* float y = event.getY(0) - event.getY(1);*
* return FloatMath.sqrt(x * x + y * y);*
* }*

* private void midPoint(PointF point, MotionEvent event) {*
* float x = event.getX(0) + event.getX(1);*
* float y = event.getY(0) + event.getY(1);*
* point.set(x / 2, y / 2);*
* }*

* /** Show an event in the LogCat view, for debugging */*
* private void dumpEvent(MotionEvent event) {*
* String names[] = { "DOWN", "UP", "MOVE", "CANCEL", "OUTSIDE",*
* "POINTER_DOWN", "POINTER_UP", "7?", "8?", "9?" };*
* StringBuilder sb = new StringBuilder();*
* int action = event.getAction();*
* int actionCode = action & MotionEvent.ACTION_MASK;*
* sb.append("event ACTION_").append(names[actionCode]);*
* if (actionCode == MotionEvent.ACTION_POINTER_DOWN*
* || actionCode == MotionEvent.ACTION_POINTER_UP) {*
* sb.append("(pid ").append(*
* action >> MotionEvent.ACTION_POINTER_ID_SHIFT);*
* sb.append(")");*
* }*
* sb.append("[");*
* for (int i = 0; i < event.getPointerCount(); i++) {*
* sb.append("#").append(i);*
* sb.append("(pid ").append(event.getPointerId(i));*
* sb.append(")=").append((int) event.getX(i));*
* sb.append(",").append((int) event.getY(i));*
* if (i + 1 < event.getPointerCount())*
* sb.append(";");*
* }*
* sb.append("]");*
* Log.d(TAG, sb.toString());*
* }*
*}*

The issue is mentioned below.

The zoom is not working perfectly. sometimes, I do a pinch or zoom, it is 
not working. 

**NOTE: But when I remove the "GestureOverlayView", the pinch and zoom 
working perfectly over that imageview. But I need "GestureOverlayView" to 
detect gesture.**

Is this a android issue or the coding issue? How can I fix this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You rece

[android-developers] SoftKeyboard - not showing the auto suggest

2014-04-09 Thread KK
I am going to do an android application. In that app, I have to add the 
customized keyboard.
So that I am trying to create my own customized keyboard. I found the code 
for the keyboard from the android sdk's sample(SoftKeyboard).
When I execute the code, the keyboard is installed and showing in my app.

The problem is,
1) The keyboard is installed and can access by all the apps. But I want to 
install it only for my app.
2) And the keyboard is not giving the auto-suggest words. So How can I show 
the auto-suggest words in that SoftKeyboard.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] how to flip the page similar to what Flipboard app does

2012-07-18 Thread KK
Thanks Harri, I'll check it out.

--KK

On Mon, Jul 16, 2012 at 1:57 PM, Harri Smått  wrote:

> I played around with the idea - and this mockup works more/less properly.
> Nothing too fancy but guess it would be possible to extend it for more
> generalized usage.
>
> https://github.com/harism/android_viewbinder
>
> --
> H
>  On Jul 16, 2012 2:54 PM, "KK"  wrote:
>
>> hi All,
>> I'm working on creating a basic app and planning to use the page flip
>> feature available on Flipboard app @
>> https://play.google.com/store/apps/details?id=flipboard.app&feature=related_apps
>>
>> Would appreciate, if someone could point me to some sample code that does
>> similar job.
>>
>>
>> Thanks  in advance!
>>
>> Regards,
>> KK
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to flip the page similar to what Flipboard app does

2012-07-15 Thread KK
hi All,
I'm working on creating a basic app and planning to use the page flip
feature available on Flipboard app @
https://play.google.com/store/apps/details?id=flipboard.app&feature=related_apps

Would appreciate, if someone could point me to some sample code that does
similar job.


Thanks  in advance!

Regards,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android program to access the remote desktop

2012-02-28 Thread vasudevan kk
Hi all,

I want to create a application for accessing the remote desktop..

please help me, and give a sample program to connect remote desktop
using android..give the instructions

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] android program to access the remote desktop

2012-02-28 Thread vasudevan kk
Hi,

I want to create a andriod program for accessing remote desktopi
am a beginner in andriod development. can you help me and give me the
instructions.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How to get Hardware and software information of remote computer in android

2012-01-23 Thread kk
I want to get Hardware and software information of remote computer
which is already in my WiFi network.I found that Windows Management
Instrumentation (WMI) is useful for getting this information in
java.But when I use this for android I got runtime errors in
com4j.jar. I can't solve these errors.If you have any suggestion or
code then please tell me.If you have another way then please suggest.I
am new to Android

I also found that python script using _winreg can be useful to access
the remote computer registry and from registry I can get this
information but I don't know how to write this script and run on
remote computer and handle output please anybody have any idea then
suggest Thanks in Advance

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Using multiple listview inside one activity, how to give focus to each

2012-01-11 Thread KK
hi All,
Has anyone any idea on this issue? Please help me out.
Appreciate your effort and time.

Thanks,
KK

On Mon, Dec 26, 2011 at 1:13 AM, KK  wrote:

> hi All,
> I'm using multiple listViews inside one activity. I'm using each listiview
> in its own UI screen layout, meaning I've two UI screens. Now when I start
> the app, I get the focus on the first app as I'm able to scroll down/up the
> list and when I switch to the 2nd listview in the 2nd UI screen, the second
> listView works fine and I'm able to scroll the list. Next, when I return
> back from the 2nd listview UI screen page to the first page screen, the
> list becomes static/freezed and I'm not able to scroll up/down but
> surprisingly when I return back to the 2nd listView, it still works fine.
> I'm not able to understand as to why both the listViews work fine initially
> but after returning back from the 2nd listView the 1st listView stops
> working/scrolling. To me it feels as if something is locked in 1st
> listView, when I'm returning back from the 2nd one and we've to enable some
> short of flag, by saying "enable this listView from scrolling/usage as
> currently this listView is in focus on screen". Would appreciate if someone
> could point me to the right direction. I'm adding some code snippets below,
>
> --
> Activity file code snippet
> --
>
> layout01 = (LinearLayout) findViewById(R.id.Layout1);
>   layout02 = (LinearLayout) findViewById(R.id.Layout2);
>   layout02.setVisibility(View.GONE);
>
> ..
> listView1 = (ListView) findViewById(R.id.list1);
>   listView2 = (ListView) findViewById(R.id.list2);
>
> this.adapter = new MovieAdapter(this);
>   listView1.setAdapter(this.adapter);
>   listView1.setItemsCanFocus(false);
>
>   listView2.setAdapter(new MovieAdapter(this));
>   listView2.setItemsCanFocus(false);
>
>
>
> -
> main.xml layout file:
> -
> http://schemas.android.com/apk/res/android";
> android:id="@+id/container"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent" >
>
>  xmlns:android="http://schemas.android.com/apk/res/android";
> android:id="@+id/Layout1"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> android:orientation="vertical" >
>
>  android:layout_width="fill_parent"
> android:layout_height="75px"
> android:scaleType="fitXY"
> android:src="@drawable/title" />
>
>
>
>  android:id="@+id/list1"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent" />
>
> 
>
>  android:id="@+id/Layout2"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent"
> android:orientation="vertical" >
>
>  android:layout_width="fill_parent"
> android:layout_height="75px"
> android:scaleType="fitXY"
> android:src="@drawable/title" />
>
>
>  android:id="@+id/list2"
> android:layout_width="fill_parent"
> android:layout_height="fill_parent" />
>
>
> 
>
> 
>
>
>
> Appreciate your time.
>
> Thanks,
> KK
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Google App Engine and Users API and android By Nikolay Elenkov - 8:38am - 3 authors - 9 replies

2012-01-08 Thread kk
Hi!
I am developing Live Wallpaper for Android and stumbled upon scrolling
wallpaper issue.
We have
onOffsetsChanged(..) function with xPixelOffset argument.
Question is, what is the maximum value of xPixelOffset value and is it
documented somewhere? Many people considered it to be (screen width *
2) and successfully used it. I myself get same result (-480 with
screen width = 240). But is it the same for every device and will it
be the same?
I just couldn't find official documentation on this and i can't
understand the logic behind this. Phone has X home screens and screen
width = W. So why can't maximum offset be say, X*W instead of 2*W?
And another question is, doesn't it mean that total width equals 3
width? Considering that real drawing area starts with 0  and ends at W
and maximum offset is 2*W, last screen ends with point of X = (W +
2*W) = 3W.
I just can't work with 2*W value now because i don't know yet whether
it's a requirement for maximum offset on every device or is it just
some of them.
Thank you and sorry for my English.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Using multiple listview inside one activity, how to give focus to each

2011-12-25 Thread KK
hi All,
I'm using multiple listViews inside one activity. I'm using each listiview
in its own UI screen layout, meaning I've two UI screens. Now when I start
the app, I get the focus on the first app as I'm able to scroll down/up the
list and when I switch to the 2nd listview in the 2nd UI screen, the second
listView works fine and I'm able to scroll the list. Next, when I return
back from the 2nd listview UI screen page to the first page screen, the
list becomes static/freezed and I'm not able to scroll up/down but
surprisingly when I return back to the 2nd listView, it still works fine.
I'm not able to understand as to why both the listViews work fine initially
but after returning back from the 2nd listView the 1st listView stops
working/scrolling. To me it feels as if something is locked in 1st
listView, when I'm returning back from the 2nd one and we've to enable some
short of flag, by saying "enable this listView from scrolling/usage as
currently this listView is in focus on screen". Would appreciate if someone
could point me to the right direction. I'm adding some code snippets below,

--
Activity file code snippet
--

layout01 = (LinearLayout) findViewById(R.id.Layout1);
  layout02 = (LinearLayout) findViewById(R.id.Layout2);
  layout02.setVisibility(View.GONE);

..
listView1 = (ListView) findViewById(R.id.list1);
  listView2 = (ListView) findViewById(R.id.list2);

this.adapter = new MovieAdapter(this);
  listView1.setAdapter(this.adapter);
  listView1.setItemsCanFocus(false);

  listView2.setAdapter(new MovieAdapter(this));
  listView2.setItemsCanFocus(false);



-
main.xml layout file:
-
http://schemas.android.com/apk/res/android";
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

http://schemas.android.com/apk/res/android";
android:id="@+id/Layout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
    android:orientation="vertical" >























Appreciate your time.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] how to select listview from multiple listviews in main.xml (on Android 2.3.3)

2011-12-25 Thread KK
Changing ListActivity to just Activity worked like a charm. You are a life
saver. Thanks a lot.

Thanks,
KK

On Sun, Dec 25, 2011 at 3:10 PM, YuviDroid  wrote:

> Hi,
>
> I believe you are using a ListActivity, which by default looks for a
> ListView with id "@android:id/list". To use custom ids change that
> ListActivity to a normal Activity.
>
>
> Cheers,
> Yuvi
> http://www.droidahead.com
>
> On Sun, Dec 25, 2011 at 9:55 AM, KK  wrote:
>
>> hi all,
>> I'm using FrameLayout and have defined two LinearLayouts embedded inside
>> the FrameLayout. Now for each LinearLayout I've a listview . The problem
>> I'm facing is picking the two listviews separately from my Java side code.
>> The default listivew in XML uses the standard defined ID as 
>> *android:id="@id/android:list"
>> *and I'm not able to pick the right one. So I decided to give custom ids
>> to each of the list view like this in Layout1:
>>   > android:id="@+id/list1"
>> android:layout_width="fill_parent"
>> android:layout_height="fill_parent" />
>>
>> and the following in Layout2
>>
>>   > android:id="@+id/list2"
>> android:layout_width="fill_parent"
>> android:layout_height="fill_parent" />
>>
>> and this is what I'm trying to use to pick the listviews separately,
>>
>>   ListView listView1 = (ListView) findViewById(R.id.list1);
>>   ListView listView2 = (ListView) findViewById(R.id.list2);
>>
>> With the above code in pace, I'm not getting any compilation errors. But
>> during run time I'm getting errors with this message:
>> *  java.lang.RuntimeException: Your content must have a ListView
>> whose id attribute is 'android.R.id.list'*
>>
>> Are we not allowed to use custom IDs for listviews? If custom IDs are not
>> allowed, then what is the best way to handle the above problem? Would
>> appreciate if someone could point me to the right direction.
>>
>> BTW, I'm actually trying to define two layouts each with its own listview
>> and then I'm trying to animate between two UI screens each using one layout
>> and the default behavior gives only one of the listivew as picked by
>> "getListView()" which happens to be the 1st one, so my 2nd UI page is not
>> showing any listview.
>>
>>
>> Thanks,
>> KK
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> YuviDroid
> Check out Launch-X <http://android.yuvalsharon.net/launchx.php> (a widget
> to quickly access your favorite apps and contacts!)
> http://android.yuvalsharon.net
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to select listview from multiple listviews in main.xml (on Android 2.3.3)

2011-12-25 Thread KK
hi all,
I'm using FrameLayout and have defined two LinearLayouts embedded inside
the FrameLayout. Now for each LinearLayout I've a listview . The problem
I'm facing is picking the two listviews separately from my Java side code.
The default listivew in XML uses the standard defined ID as
*android:id="@id/android:list"
*and I'm not able to pick the right one. So I decided to give custom ids to
each of the list view like this in Layout1:
  

and the following in Layout2

  

and this is what I'm trying to use to pick the listviews separately,

  ListView listView1 = (ListView) findViewById(R.id.list1);
  ListView listView2 = (ListView) findViewById(R.id.list2);

With the above code in pace, I'm not getting any compilation errors. But
during run time I'm getting errors with this message:
*  java.lang.RuntimeException: Your content must have a ListView whose
id attribute is 'android.R.id.list'*

Are we not allowed to use custom IDs for listviews? If custom IDs are not
allowed, then what is the best way to handle the above problem? Would
appreciate if someone could point me to the right direction.

BTW, I'm actually trying to define two layouts each with its own listview
and then I'm trying to animate between two UI screens each using one layout
and the default behavior gives only one of the listivew as picked by
"getListView()" which happens to be the 1st one, so my 2nd UI page is not
showing any listview.


Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Does the mediaplayer keep running even in orientation change ?

2011-11-29 Thread KK
hi All,
I'm working on a small app where I'm trying to play one mp3 media using the
default mediaplayer (android.media.MediaPlayer). In this regard, I wanted
to know, does the mediaplayer keep running even when the orientation
changes? I think, since the mediaplayer runs as a service, it must be
running until we manually release the mediaplayer using something like:
mMediaPlayer.release(). Would appreciate if someone can point me in the
right direction.

Actually, I'm trying to understand how to save states and what all I've to
save during orientation change. As a sample I'm able to save the state of a
continuously updating seekbar during orientation change and wanted to
implement the same feature for media player as well. I don't think we'll
have to stop and restart the mediaplayer during orientation changes. I even
tried the default player on my android device and I did not notice any such
lag during orientation changes, it just plays smoothly.

Appreciate your time.


Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread KK
Thank you very much Mark. I used both the flags in "OR" and it worked. I
should have tried it as per your last hint. Thanks again.

Regards,
KK

On Sat, Nov 26, 2011 at 6:12 PM, Mark Murphy wrote:

> The only times I've done this with Notifications, I have used
> FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP. I assumed
> FLAG_ACTIVITY_REORDER_TO_FRONT would work as well, but apparently I am
> mistaken.
>
> On Sat, Nov 26, 2011 at 7:29 AM, KK  wrote:
> > Thanks for the hints. I'm trying to use
> the FLAG_ACTIVITY_REORDER_TO_FRONT
> > flag but the behavior remains as earlier. After the activity starts, I
> press
> > "Menu" to go to home and then pull down the "Notification list" click on
> the
> > current one (for my demopendingintent activity) and it brings me a new
> > activity page. I've added exit buttons and logs through which I'm able to
> > conclude that it starts a new activity rather than bringing the one
> running
> > in the background. May be I'm doing something wrong in my code. Please
> find
> > below the code snippet I'm using for showing notifications etc.
> > ---code snippet
> > private void showNotification() {
> > mNotificationManager = (NotificationManager)
> > getSystemService(NOTIFICATION_SERVICE);
> > // //Add current song to notification bar
> > CharSequence tickerText = "Demo Alert";
> > long when = System.currentTimeMillis();
> > CharSequence contentTitle = "Now playing";
> > CharSequence contentText = "Demo song";
> > Intent notificationIntent = new Intent(this,
> > DemoPendingIntentActivity.class);
> > notificationIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
> > PendingIntent pendingIntent = PendingIntent.getActivity(
> > getApplicationContext(), 0, notificationIntent, 0);
> > Notification notification = new Notification(
> > R.drawable.ic_stat_playing, tickerText, when);
> > notification.setLatestEventInfo(getApplicationContext(), contentTitle,
> > contentText, pendingIntent);
> > notification.contentIntent = pendingIntent;
> > // Make the notification non-clearable
> > notification.flags = Notification.FLAG_ONGOING_EVENT;
> > mNotificationManager.notify(notificationId, notification);
> > }
> >
> > and the onCreate() is given below:
> > public void onCreate(Bundle savedInstanceState) {
> > super.onCreate(savedInstanceState);
> > setContentView(R.layout.main);
> > mButton = (Button) findViewById(R.id.button1);
> > mButton.setOnClickListener(new OnClickListener() {
> > @Override
> > public void onClick(View arg0) {
> > // TODO Auto-generated method stub
> > Log.d(TAG, "Shutting down app");
> > finish();
> > }
> > });
> > showNotification();
> > }
> > --- code snippet
> > Would appreciate if someone can point me whats going wrong here. Many
> > thanks.
> > Regards,
> > KK
> >
> > On Sat, Nov 26, 2011 at 5:25 PM, Mark Murphy 
> > wrote:
> >>
> >> Add either FLAG_ACTIVITY_REORDER_TO_FRONT or the combination of
> >> FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP as flags to your
> >> Intent. The latter finishes all other activities that might be on your
> >> back stack; the former simply brings any existing copy of the activity
> >> back to the foreground.
> >>
> >> On Sat, Nov 26, 2011 at 4:51 AM, KK  wrote:
> >> > hi All,
> >> > I'm trying to use Notification manager and Pending Intent so that
> >> > whenever
> >> > the user clicks the notification the currently running activity's UI
> is
> >> > shown. However in the code I'm using, as shown below opens up a new
> >> > instance
> >> > of the app instead of leading the user to the currently running one:
> >> > ---code snippet
> >> > mNotificationManager = (NotificationManager)
> >> > getSystemService(NOTIFICATION_SERVICE);
> >> > // //Add current song to notification bar
> >> > CharSequence tickerText = "Demo Alert";
> >> > long when = System.currentTimeMillis();
> >> > CharSequence contentTitle = "Now playing";
> >> > CharSequence contentText = "Demo song";
> >> > PendingIntent pendingIntent = PendingIntent.getActivity(
> >> > getApplicationContext(), 0, new Intent(this,
> >> > DemoPendingIntentActivity.class), 0);
> >> > Notification notification = new Notification(
> >> > R.drawable.ic_st

Re: [android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread KK
Thanks for the hints. I'm trying to use the FLAG_ACTIVITY_REORDER_TO_FRONT
flag but the behavior remains as earlier. After the activity starts, I
press "Menu" to go to home and then pull down the "Notification list" click
on the current one (for my demopendingintent activity) and it brings me a
new activity page. I've added exit buttons and logs through which I'm able
to conclude that it starts a new activity rather than bringing the one
running in the background. May be I'm doing something wrong in my code.
Please find below the code snippet I'm using for showing notifications etc.

---code snippet

private void showNotification() {
mNotificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
 // //Add current song to notification bar
CharSequence tickerText = "Demo Alert";
 long when = System.currentTimeMillis();
CharSequence contentTitle = "Now playing";
 CharSequence contentText = "Demo song";

Intent notificationIntent = new Intent(this,
 DemoPendingIntentActivity.class);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

PendingIntent pendingIntent = PendingIntent.getActivity(
getApplicationContext(), 0, notificationIntent, 0);

Notification notification = new Notification(
R.drawable.ic_stat_playing, tickerText, when);
 notification.setLatestEventInfo(getApplicationContext(), contentTitle,
contentText, pendingIntent);
 notification.contentIntent = pendingIntent;
// Make the notification non-clearable
 notification.flags = Notification.FLAG_ONGOING_EVENT;
mNotificationManager.notify(notificationId, notification);
 }


*and the onCreate() is given below:*

public void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
setContentView(R.layout.main);

 mButton = (Button) findViewById(R.id.button1);
mButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
 Log.d(TAG, "Shutting down app");
finish();

 }
});

showNotification();
 }

--- code snippet

Would appreciate if someone can point me whats going wrong here. Many
thanks.

Regards,
KK

On Sat, Nov 26, 2011 at 5:25 PM, Mark Murphy wrote:

> Add either FLAG_ACTIVITY_REORDER_TO_FRONT or the combination of
> FLAG_ACTIVITY_SINGLE_TOP and FLAG_ACTIVITY_CLEAR_TOP as flags to your
> Intent. The latter finishes all other activities that might be on your
> back stack; the former simply brings any existing copy of the activity
> back to the foreground.
>
> On Sat, Nov 26, 2011 at 4:51 AM, KK  wrote:
> > hi All,
> > I'm trying to use Notification manager and Pending Intent so that
> whenever
> > the user clicks the notification the currently running activity's UI is
> > shown. However in the code I'm using, as shown below opens up a new
> instance
> > of the app instead of leading the user to the currently running one:
> > ---code snippet
> > mNotificationManager = (NotificationManager)
> > getSystemService(NOTIFICATION_SERVICE);
> > // //Add current song to notification bar
> > CharSequence tickerText = "Demo Alert";
> > long when = System.currentTimeMillis();
> > CharSequence contentTitle = "Now playing";
> > CharSequence contentText = "Demo song";
> > PendingIntent pendingIntent = PendingIntent.getActivity(
> > getApplicationContext(), 0, new Intent(this,
> > DemoPendingIntentActivity.class), 0);
> > Notification notification = new Notification(
> > R.drawable.ic_stat_playing, tickerText, when);
> > notification.setLatestEventInfo(getApplicationContext(), contentTitle,
> > contentText, pendingIntent);
> > notification.contentIntent = pendingIntent;
> > // Make the notification non-clearable
> > notification.flags = Notification.FLAG_ONGOING_EVENT;
> > mNotificationManager.notify(notificationId, notification);
> > ---code snippet
> > How do I open up the currently running activity instead of opening a new
> > one? Please let me know whats going wrong in the above code. Appreciate
> your
> > time.
> > Thanks,
> > KK
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
>
>
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Ap

[android-developers] How to use PendingIntent to open existing activity and not a new one

2011-11-26 Thread KK
hi All,
I'm trying to use Notification manager and Pending Intent so that whenever
the user clicks the notification the currently running activity's UI is
shown. However in the code I'm using, as shown below opens up a new
instance of the app instead of leading the user to the currently running
one:

---code snippet
mNotificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
// //Add current song to notification bar
 CharSequence tickerText = "Demo Alert";
long when = System.currentTimeMillis();
 CharSequence contentTitle = "Now playing";
CharSequence contentText = "Demo song";
 PendingIntent pendingIntent = PendingIntent.getActivity(
getApplicationContext(), 0, new Intent(this,
 DemoPendingIntentActivity.class), 0);

Notification notification = new Notification(
 R.drawable.ic_stat_playing, tickerText, when);
notification.setLatestEventInfo(getApplicationContext(), contentTitle,
 contentText, pendingIntent);
notification.contentIntent = pendingIntent;
 // Make the notification non-clearable
notification.flags = Notification.FLAG_ONGOING_EVENT;
 mNotificationManager.notify(notificationId, notification);
---code snippet

How do I open up the currently running activity instead of opening a new
one? Please let me know whats going wrong in the above code. Appreciate
your time.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread KK
hi Pskink,
That actually worked, I moved the timer.cancel() before releasing the
mediaplayer. But what is the logical reasoning behind this, would you mind
explaining in a word or two? or may be point me to any web reference that
explains the thing. Thanks in advance.

Regards,
KK

On Sat, Nov 26, 2011 at 1:56 PM, skink  wrote:

>
>
> KK wrote:
> > hi,
> > Seems the logcat
> >
> > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
> > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
> > java.lang.IllegalStateException
> > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
> > android.media.MediaPlayer.getCurrentPosition(Native Method)
> > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
> >
> com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
> > 11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
> > java.util.Timer$TimerImpl.run(Timer.java:284)
> >
> >
>
>
> Try to cancel() the timer before releazing media player
>
> Also try to avoid Timer/TimerTask, use Handler instead
>
> pskink
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-26 Thread KK
hi,
Seems the logcat

11-26 13:32:06.727: ERROR/AndroidRuntime(10779): FATAL EXCEPTION: Timer-0
11-26 13:32:06.727: ERROR/AndroidRuntime(10779):
java.lang.IllegalStateException
11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
android.media.MediaPlayer.getCurrentPosition(Native Method)
11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
com.infineon.musicplayer4mNet.MusicPlayerActivity$2.run(MusicPlayerActivity.java:174)
11-26 13:32:06.727: ERROR/AndroidRuntime(10779): at
java.util.Timer$TimerImpl.run(Timer.java:284)


is pointing to the following location(Line 174). I'm using the following
code to play a user-selected song



try {
mMediaPlayer.reset();
mMediaPlayer.setDataSource(filename);
 mMediaPlayer.prepare();
mMediaPlayer.start();
showNotification(finalPosition);
 Log.d(TAG, "duration: " + mMediaPlayer.getDuration());
mSeekBar.setMax(mMediaPlayer.getDuration());
 // Keep updating the seekbar with current position

timer.schedule(new TimerTask() {

@Override
public void run() {
// TODO Auto-generated method stub
 if (null != mMediaPlayer
&& mMediaPlayer.getCurrentPosition() < mMediaPlayer
 .getDuration()) {
mSeekBar.setProgress(mMediaPlayer.getCurrentPosition());
 }

}
}, 100, 200);

mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {

@Override
 public void onCompletion(MediaPlayer arg0) {
nextSong();
}
 });
} catch (Exception e) {
e.printStackTrace();
 }



As the error is pointing to this line
   *if (null != mMediaPlayer && mMediaPlayer.getCurrentPosition() <
mMediaPlayer.getDuration())*
*
*
something is wrong here but surprisingly this is working fine on emulator
without any such error, any idea how is that possible?
 Thanks for your help.

Regards,
KK





On Sat, Nov 26, 2011 at 1:21 PM, Raghav Sood  wrote:

> Logcat?
>
> On Sat, Nov 26, 2011 at 1:14 PM, KK  wrote:
>
>> hi All,
>> I'm trying to exit the application using the following code in my
>> mediaplayer app. While it works fine in the emulator(2.2) but when I run
>> the app on an actual device (with 2.3.4 ) it gives me ANR error. Would
>> appreciate if someone can point me what is going wrong.
>>
>> code snippet-
>> @Override
>> public boolean onOptionsItemSelected(MenuItem item) {
>> switch (item.getItemId()) {
>> ...
>>
>> case R.id.exit:
>> Log.d(TAG, "Shutting down the service");
>>  if (mMediaPlayer != null) {
>>  mMediaPlayer.release();
>> mMediaPlayer = null;
>> // remove all notifications
>>  mNotificationManager.cancelAll();
>> timer.cancel();
>> finish();
>>  return true;
>>
>> 
>> ---code snippet-
>> Just a note that I'm using notifications to show current song being
>> played, using Timer for continuously updating the seekbar for the current
>> song being played.
>>
>> Appreciate your time. Many thanks.
>>
>> Regards,
>> KK
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> Raghav Sood
> http://www.androidactivist.org/ - Author
> http://www.appaholics.in/ - Founder
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Trying to exit app( using finish() ) gives ANR on device but not on emulator

2011-11-25 Thread KK
hi All,
I'm trying to exit the application using the following code in my
mediaplayer app. While it works fine in the emulator(2.2) but when I run
the app on an actual device (with 2.3.4 ) it gives me ANR error. Would
appreciate if someone can point me what is going wrong.

code snippet-
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
...

case R.id.exit:
Log.d(TAG, "Shutting down the service");
 if (mMediaPlayer != null) {
 mMediaPlayer.release();
mMediaPlayer = null;
// remove all notifications
 mNotificationManager.cancelAll();
timer.cancel();
finish();
 return true;


---code snippet-
Just a note that I'm using notifications to show current song being played,
using Timer for continuously updating the seekbar for the current song
being played.

Appreciate your time. Many thanks.

Regards,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] ListView text goes black when scrolling the content

2011-11-25 Thread KK
It really solved the problem. You are a lifesaver. Thank you very much.

Regards,
KK

On Fri, Nov 25, 2011 at 5:05 PM, Mukesh Srivastav wrote:

> Hi KK,
>
> Please add the following line to your listview, The problem get solves.
>
> android:cacheColorHint="#"
>
>
> Warm Regards,
> *Mukesh Kumar*,
> Android Consultant/Freelancer,
> India,Hyderabad.
>
>
> On Fri, Nov 25, 2011 at 4:59 PM, KK  wrote:
>
>> Hi All,
>> I'm trying to show a list of songs using ListView (which supports
>> scrolling when the song list grows bigger than the available screen). In
>> this regard, I'm able to show the list of songs but whenever the user tries
>> to scroll the screen up/down the part of the screen which has the text,
>>  goes black  as can be seen here (and is not readable):
>>   http://imageshack.us/photo/my-images/706/device2025132814.png/
>>
>>   http://imageshack.us/photo/my-images/17/device2025132731.png/
>>
>> Only when the user is done scrolling then dark portion goes out and the
>> screen starts showing the song list normally and is readable. I've tested
>> this on Android 2.3.4 real device. Would appreciate if someone could point
>> me what is going wrong here.
>>
>> The code snippet for generating the song list is as below:
>>
>> snippet
>>
>> 
>>  http://schemas.android.com/apk/res/android";
>> android:background="@drawable/statue_of_liberty_600x800"
>>  android:orientation="vertical" android:layout_width="fill_parent"
>> android:layout_height="fill_parent">
>>  > android:dividerHeight="0dp" android:layout_width="fill_parent"
>>  android:layout_weight="9"
>> android:layout_height="382dp" android:layout_marginLeft="10dp"
>>  android:layout_marginRight="10dp" android:layout_marginBottom="10dp"
>> android:layout_marginTop="10dp">
>>  
>> > android:layout_width="fill_parent"
>>  android:layout_height="fill_parent" android:text="No songs found on SD
>> Card."
>> android:paddingTop="60dp" />
>>  > android:layout_width="match_parent" android:id="@+id/seekBar1"
>>  android:layout_marginTop="10dp" android:layout_weight="1"
>> android:layout_marginLeft="15dp" android:layout_marginRight="15dp"
>> android:layout_marginBottom="15dp">
>>  
>> 
>>
>> snippet---
>>
>>
>> Appreciate your time. Thanks.
>>
>> Regards,
>> KK
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> Warm Regards,
> *Mukesh Kumar*,
> Android Consultant/Freelancer,
> India,Hyderabad.
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] ListView text goes black when scrolling the content

2011-11-25 Thread KK
Hi All,
I'm trying to show a list of songs using ListView (which supports scrolling
when the song list grows bigger than the available screen). In this regard,
I'm able to show the list of songs but whenever the user tries to scroll
the screen up/down the part of the screen which has the text,  goes black
 as can be seen here (and is not readable):
  http://imageshack.us/photo/my-images/706/device2025132814.png/
  http://imageshack.us/photo/my-images/17/device2025132731.png/

Only when the user is done scrolling then dark portion goes out and the
screen starts showing the song list normally and is readable. I've tested
this on Android 2.3.4 real device. Would appreciate if someone could point
me what is going wrong here.

The code snippet for generating the song list is as below:

snippet


http://schemas.android.com/apk/res/android";
android:background="@drawable/statue_of_liberty_600x800"
 android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
 
 

 
 


----snippet---


Appreciate your time. Thanks.

Regards,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] does android.media.Mediaplayer support asf stream playing ?

2011-11-09 Thread KK
hi All,
I was just trying to figure out, if there is any option for playing ASF
streams. I tried searching in google but couldn't find any solid answer.
Would appreciate if someone can let us know if the the inbuilt
mediaplyer( android.media.MediaPlayer) supports playing this format, can we
play asf stream media similar to other formats like shoutcast mp3 etc.
Also, it would be helpful if someone can point me to the proper
URL/tutorial for playing asf streams. Actually I'm trying to write a small
app that plays couple of stream media formats.
Appreciate your time.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Can we use a scrollview inside linear layout?

2011-11-06 Thread KK
Thanks for the quick tip, I'll try it out. I've a question though. Is it
the case that the lisview inherently supports scrolling when the no of
items grows bigger than the display area, and hence we don't need to sue
scrollview in this case? If that is the case then, as per your suggestion,
in my case if the no of items is say 50 then they will automatically be
scrollable, right? Please rectify if I'm wrong.

Thanks,
kk

On Mon, Nov 7, 2011 at 12:25 AM, Dianne Hackborn wrote:

> Yes, you can, but you really should use a ListView instead of a ScrollView
> if you have a lot of items to show or the dynamically change.
>
> On the top view use android:layout_weight="1" and
> android:layout_height="0px" to tell it to grow to fill whatever space is
> available.
>
> On Sun, Nov 6, 2011 at 8:56 AM, KK  wrote:
>
>> hi All,
>> I'm not sure if the asking I'm asking is logical or wrong. Actually I'm
>> trying to achieve something like this:
>> 1. The whole screen is divided into two parts, Upper half which takes 90%
>> of layout space and the lower half which is 10% of the space.
>> 2. In the lower half I'm showing the progress bar for each song selected
>> from the Upper half.
>> 3. In the upper half I'm trying to show all the songs in the sdcard
>> available. I'm trying to make this part scrollable as we can have lots of
>> song which wont fit in the given space.
>>
>> I want the lower part to remain fixed irrespective of the current
>> selection in the Upper half, say for example if I'm playing the 50th
>> song(out of 100) then song will be in the middle of the Upper screen space
>> where as the lower half will continue to show the current song position.
>>
>> Logically, I'm trying to do something like this in the layout file
>>
>> 
>> 
>>   layout_weight=9
>>   sldjfsldf
>>  
>>song lsit
>>  
>>      ..
>> 
>> 
>>  layout_weight=1
>>sdljfsldjf
>> 
>>
>> 
>>
>>
>> Please help me how to get this done. Would appreciate other ways of
>> achieving my end result by some other elegant approach.
>> Thanks in advance.
>>
>> Regards,
>> KK
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Can we use a scrollview inside linear layout?

2011-11-06 Thread KK
hi All,
I'm not sure if the asking I'm asking is logical or wrong. Actually I'm
trying to achieve something like this:
1. The whole screen is divided into two parts, Upper half which takes 90%
of layout space and the lower half which is 10% of the space.
2. In the lower half I'm showing the progress bar for each song selected
from the Upper half.
3. In the upper half I'm trying to show all the songs in the sdcard
available. I'm trying to make this part scrollable as we can have lots of
song which wont fit in the given space.

I want the lower part to remain fixed irrespective of the current selection
in the Upper half, say for example if I'm playing the 50th song(out of 100)
then song will be in the middle of the Upper screen space where as the
lower half will continue to show the current song position.

Logically, I'm trying to do something like this in the layout file



  layout_weight=9
  sldjfsldf
 
   song lsit
 
 ..


 layout_weight=1
   sdljfsldjf





Please help me how to get this done. Would appreciate other ways of
achieving my end result by some other elegant approach.
Thanks in advance.

Regards,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Screen Orientation changes automatically in 2.2 emulator

2011-10-31 Thread KK
Hi All,
I'm trying to create a simple stream media player app. Though the media
player is working fine and I'm able to play shoutcast stream, but I'm
facing a weird problem, screen orientation changes automatically in periods
of : 2mins of start of app---15 secs---15 secs---2minutes and the cycle
continues. The time is not 100% accurate, and just my observation. Would
appreciate if someone could point me what could be causing this problem.
Thanks for your time. Just a note, that I'm running the app on android
emulator and I'm on 2.2 API series.


10-31 21:04:41.830: INFO/WindowManager(59): *Setting rotation to 1,
animFlags=0*
10-31 21:04:41.840: INFO/ActivityManager(59): Config changed: { scale=1.0
imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=2 layout=18
uiMode=17 seq=34}
10-31 21:04:41.870: ERROR/QemuSensors(59): data__poll: len=-1, errno=0:
Unknown error: 0
10-31 21:04:41.870: ERROR/QemuSensors(59): data__poll: len=-1, errno=0:
Unknown error: 0
10-31 21:04:41.870: ERROR/QemuSensors(59): data__poll: len=-1, errno=0:
Unknown error: 0
10-31 21:04:42.040: ERROR/QemuSensors(3813): data__poll: len=-1, errno=9:
Bad file number
10-31 21:04:42.040: ERROR/QemuSensors(3813): data__poll: len=-1, errno=9:
Bad file number
10-31 21:04:42.040: ERROR/QemuSensors(59): data__poll: len=-1, errno=0:
Unknown error: 0
10-31 21:04:42.620: DEBUG/dalvikvm(170): GC_FOR_MALLOC freed 11469 objects
/ 509344 bytes in 633ms
10-31 21:04:44.349: WARN/AudioFlinger(34): write blocked for 71 msecs,
57716 delayed writes, thread 0xb3f0
10-31 21:04:44.600: DEBUG/dalvikvm(59): GC_EXPLICIT freed 1748 objects /
69712 bytes in 157ms
10-31 21:04:49.435: WARN/AudioFlinger(34): write blocked for 74 msecs,
57757 delayed writes, thread 0xb3f0
10-31 21:04:52.620: INFO/WindowManager(59): *Setting rotation to 0,
animFlags=0*
10-31 21:04:52.620: INFO/ActivityManager(59): Config changed: { scale=1.0
imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18
uiMode=17 seq=35}
10-31 21:04:54.502: WARN/AudioFlinger(34): write blocked for 71 msecs,
57790 delayed writes, thread 0xb3f0
10-31 21:04:55.290: DEBUG/dalvikvm(59): GC_EXPLICIT freed 335 objects /
16072 bytes in 234ms
10-31 21:04:59.549: WARN/AudioFlinger(34): write blocked for 70 msecs,
57824 delayed writes, thread 0xb3f0
10-31 21:05:04.715: WARN/AudioFlinger(34): write blocked for 72 msecs,
57863 delayed writes, thread 0xb3f0
10-31 21:05:09.814: WARN/AudioFlinger(34): write blocked for 71 msecs,
57910 delayed writes, thread 0xb3f0
10-31 21:05:09.830: ERROR/QemuSensors(59): data__poll: len=-1, errno=0:
Unknown error: 0
10-31 21:05:09.830: INFO/WindowManager(59): *Setting rotation to 1,
animFlags=0*
10-31 21:05:09.840: INFO/ActivityManager(59): Config changed: { scale=1.0
imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=2 layout=18
uiMode=17 seq=36}
10-31 21:05:09.860: ERROR/QemuSensors(3813): data__poll: len=-1, errno=9:
Bad file number
10-31 21:05:12.540: DEBUG/dalvikvm(59): GC_EXPLICIT freed 443 objects /
1 bytes in 141ms
10-31 21:05:15.170: WARN/AudioFlinger(34): write blocked for 80 msecs,
57942 delayed writes, thread 0xb3f0
10-31 21:05:20.290: WARN/AudioFlinger(34): write blocked for 77 msecs,
57984 delayed writes, thread 0xb3f0
10-31 21:05:22.029: INFO/WindowManager(59): *Setting rotation to 0,
animFlags=0*
10-31 21:05:22.029: INFO/ActivityManager(59): Config changed: { scale=1.0
imsi=310/260 loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18
uiMode=17 seq=37}
10-31 21:05:24.630: DEBUG/dalvikvm(59): GC_EXPLICIT freed 216 objects /
9928 bytes in 137ms


Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to add custom TTS(text to speech) engines for unsupported Languages

2011-10-25 Thread KK
Hi All,
Currently, I'm trying to Hindi TTS support in my app, but the immediate
problem I ran into is that, there is no direct support for hindi TTS. So, I
tried searching in google for various options on to get this thing done and
bumped into couple of interesting things like:

http://groups.google.com/group/tts-for-android/browse_thread/thread/ff5f891b5e3daaec

After going through the link mentioned therein, I could not figure out much.
Would appreciated if someone could point me in the right direction or help
me out on how to integrate raw TTS files for hindi in Android system. Any
other suggestion to achieve the same result is more than welcome.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Using the example code I'm tyring to add a custom layout for notification,
but nothing shows up. Can anyone help me out?



RemoteViews contentView = new RemoteViews(getPackageName(),
 R.layout.mynotification);
 contentView.setImageViewResource(R.id.image, R.drawable.icon);
 contentView.setTextViewText(R.id.title, "Custom notification");
 contentView.setTextViewText(R.id.text,
 "This is a custom layout");
 Notification notification = new Notification();
 notification.contentView = contentView;
 Intent notificationIntent = new Intent(this, MusicDroid.class);
 PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
 notificationIntent, 0);
 notification.contentIntent = contentIntent;
 mNotificationManager.notify(notificationId, notification);

and the mynotificaiton.xml layout is like this:


http://schemas.android.com/apk/res/android";
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp" >

    




Thanks for your time.
KK


On Tue, Oct 25, 2011 at 3:12 PM, KK  wrote:

> thanks, got it. let me add the url for others reference
>
> http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomExpandedView
>
> --kk
>
>
> On Tue, Oct 25, 2011 at 2:38 PM, Zsolt Vasvari  wrote:
>
>> I don't have any sample code.  That's what the Android Samples are
>> for.  I am sure there is one that uses a custom layout.
>>
>> On Oct 25, 5:04 pm, KK  wrote:
>> > Hi Vasvari,
>> > Thanks for your answer. I got the point that we've to use custom layout,
>> but
>> > dont know how do I hookup the custom layout to the notification event,
>> would
>> > appreciate if you can point me to some sample code.
>> >
>> > Thanks,
>> > KK
>> >
>> >
>> >
>> > On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari 
>> wrote:
>> > > Create your own Notification layout and set ellipsize to end.
>> >
>> > > On Oct 25, 4:42 pm, KK  wrote:
>> > > > Hi All,
>> > > > Can someone tell me if its possible to move/scroll the notification
>> > > message
>> > > > from one direction to the other(say from right to left). If yes,
>> then how
>> > > to
>> > > > achieve the same ?
>> > > > Actually as part of my media player, I want to show current song
>> title
>> > > > through notification and as the space is small, I want to make it
>> scroll
>> > > so
>> > > > that the enduser can see the full text being displayed through
>> > > > notification.
>> > > > Thanks for your time.
>> >
>> > > > Regards,
>> > > > KK
>> >
>> > > --
>> > > You received this message because you are subscribed to the Google
>> > > Groups "Android Developers" group.
>> > > To post to this group, send email to
>> android-developers@googlegroups.com
>> > > To unsubscribe from this group, send email to
>> > > android-developers+unsubscr...@googlegroups.com
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted
>> text -
>> >
>> > - Show quoted text -
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
thanks, got it. let me add the url for others reference
http://developer.android.com/guide/topics/ui/notifiers/notifications.html#CustomExpandedView

--kk

On Tue, Oct 25, 2011 at 2:38 PM, Zsolt Vasvari  wrote:

> I don't have any sample code.  That's what the Android Samples are
> for.  I am sure there is one that uses a custom layout.
>
> On Oct 25, 5:04 pm, KK  wrote:
> > Hi Vasvari,
> > Thanks for your answer. I got the point that we've to use custom layout,
> but
> > dont know how do I hookup the custom layout to the notification event,
> would
> > appreciate if you can point me to some sample code.
> >
> > Thanks,
> > KK
> >
> >
> >
> > On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari 
> wrote:
> > > Create your own Notification layout and set ellipsize to end.
> >
> > > On Oct 25, 4:42 pm, KK  wrote:
> > > > Hi All,
> > > > Can someone tell me if its possible to move/scroll the notification
> > > message
> > > > from one direction to the other(say from right to left). If yes, then
> how
> > > to
> > > > achieve the same ?
> > > > Actually as part of my media player, I want to show current song
> title
> > > > through notification and as the space is small, I want to make it
> scroll
> > > so
> > > > that the enduser can see the full text being displayed through
> > > > notification.
> > > > Thanks for your time.
> >
> > > > Regards,
> > > > KK
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en- Hide quoted
> text -
> >
> > - Show quoted text -
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Just to add one more info, that I'm running this app on API 8/Android 2.2

Thanks,
KK

On Tue, Oct 25, 2011 at 2:34 PM, KK  wrote:

> Hi Vasvari,
> Thanks for your answer. I got the point that we've to use custom layout,
> but dont know how do I hookup the custom layout to the notification event,
> would appreciate if you can point me to some sample code.
>
> Thanks,
> KK
>
>
> On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari  wrote:
>
>> Create your own Notification layout and set ellipsize to end.
>>
>> On Oct 25, 4:42 pm, KK  wrote:
>> > Hi All,
>> > Can someone tell me if its possible to move/scroll the notification
>> message
>> > from one direction to the other(say from right to left). If yes, then
>> how to
>> > achieve the same ?
>> > Actually as part of my media player, I want to show current song title
>> > through notification and as the space is small, I want to make it scroll
>> so
>> > that the enduser can see the full text being displayed through
>> > notification.
>> > Thanks for your time.
>> >
>> > Regards,
>> > KK
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Android Developers" group.
>> To post to this group, send email to android-developers@googlegroups.com
>> To unsubscribe from this group, send email to
>> android-developers+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/android-developers?hl=en
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Hi Vasvari,
Thanks for your answer. I got the point that we've to use custom layout, but
dont know how do I hookup the custom layout to the notification event, would
appreciate if you can point me to some sample code.

Thanks,
KK

On Tue, Oct 25, 2011 at 2:15 PM, Zsolt Vasvari  wrote:

> Create your own Notification layout and set ellipsize to end.
>
> On Oct 25, 4:42 pm, KK  wrote:
> > Hi All,
> > Can someone tell me if its possible to move/scroll the notification
> message
> > from one direction to the other(say from right to left). If yes, then how
> to
> > achieve the same ?
> > Actually as part of my media player, I want to show current song title
> > through notification and as the space is small, I want to make it scroll
> so
> > that the enduser can see the full text being displayed through
> > notification.
> > Thanks for your time.
> >
> > Regards,
> > KK
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to make the Notification message move/scroll right to left(or vice versa)

2011-10-25 Thread KK
Hi All,
Can someone tell me if its possible to move/scroll the notification message
from one direction to the other(say from right to left). If yes, then how to
achieve the same ?
Actually as part of my media player, I want to show current song title
through notification and as the space is small, I want to make it scroll so
that the enduser can see the full text being displayed through
notification.
Thanks for your time.

Regards,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to play .asx streams in Android ?

2011-10-22 Thread KK
Hi All,
Just wondering, is there any way we can play .asx streams on Android. I was
searching on google, but could not find any positive answers over there. Is
there any third party utility through which we can play this kind of streams
on android phones?

Appreciate your time.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to pull information like current song, user-count etc from shoutcast URL in Android

2011-10-20 Thread KK
Hi All,
I've not tried the stramscrapper one available @
http://code.google.com/p/streamscraper/, however, I bumped into one more
metadata scrapper and found it to be working fine(some minor glitches here
and there). You can find the same here:
   http://uniqueculture.net/2010/11/stream-metadata-plain-java/

Hope someone will find this useful.

Thanks,
KK
On Thu, Oct 20, 2011 at 10:23 PM, KK  wrote:

> Hi All,
>
> Found something useful, let me try this and will post how well it goes. For
> others reference, this is the URL:
>  http://code.google.com/p/streamscraper/
>
> --KK
>
> On Tue, Oct 18, 2011 at 11:33 PM, KK  wrote:
>
>> Hi All,
>> I'm not sure if my question fully belongs to this dev group, apologies for
>> any mistake.
>>
>> As part of my stream media player development, I''m done with playing the
>> stream media, using the standard/default media
>> player(android.media.MediaPlayer) available as part of android OS. Now the
>> next feature I'm trying to add to this app, is to show the current song
>> being played, user count connected to the shoutcast sever etc. I tried to
>> google around and found something:
>>
>> http://www.hrupin.com/2011/02/27/example-of-streaming-mp3-mediafile-with-android-mediaplayer-class
>>http://www.smackfu.com/stuff/programming/shoutcast.html
>>
>> Went through the link, but not able to figure out much. I found the
>> explanation in 2nd link above quite useful but don't know if there is
>> exiting third party utility. Actually, I'm thinking of some third party
>> JAR/utility which might be providing some simple API calls, say with the
>> shoutcast URL and provides the basic information like: current song, stream
>> speed say in kbps, listening user count etc.
>>
>> Any help would be highly appreciated.
>>
>> Thanks for your time.
>> --KK
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to pull information like current song, user-count etc from shoutcast URL in Android

2011-10-20 Thread KK
Hi All,

Found something useful, let me try this and will post how well it goes. For
others reference, this is the URL:
 http://code.google.com/p/streamscraper/

--KK
On Tue, Oct 18, 2011 at 11:33 PM, KK  wrote:

> Hi All,
> I'm not sure if my question fully belongs to this dev group, apologies for
> any mistake.
>
> As part of my stream media player development, I''m done with playing the
> stream media, using the standard/default media
> player(android.media.MediaPlayer) available as part of android OS. Now the
> next feature I'm trying to add to this app, is to show the current song
> being played, user count connected to the shoutcast sever etc. I tried to
> google around and found something:
>
> http://www.hrupin.com/2011/02/27/example-of-streaming-mp3-mediafile-with-android-mediaplayer-class
>http://www.smackfu.com/stuff/programming/shoutcast.html
>
> Went through the link, but not able to figure out much. I found the
> explanation in 2nd link above quite useful but don't know if there is
> exiting third party utility. Actually, I'm thinking of some third party
> JAR/utility which might be providing some simple API calls, say with the
> shoutcast URL and provides the basic information like: current song, stream
> speed say in kbps, listening user count etc.
>
> Any help would be highly appreciated.
>
> Thanks for your time.
> --KK
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to pull information like current song, user-count etc from shoutcast URL in Android

2011-10-18 Thread KK
Hi All,
I'm not sure if my question fully belongs to this dev group, apologies for
any mistake.

As part of my stream media player development, I''m done with playing the
stream media, using the standard/default media
player(android.media.MediaPlayer) available as part of android OS. Now the
next feature I'm trying to add to this app, is to show the current song
being played, user count connected to the shoutcast sever etc. I tried to
google around and found something:

http://www.hrupin.com/2011/02/27/example-of-streaming-mp3-mediafile-with-android-mediaplayer-class
   http://www.smackfu.com/stuff/programming/shoutcast.html

Went through the link, but not able to figure out much. I found the
explanation in 2nd link above quite useful but don't know if there is
exiting third party utility. Actually, I'm thinking of some third party
JAR/utility which might be providing some simple API calls, say with the
shoutcast URL and provides the basic information like: current song, stream
speed say in kbps, listening user count etc.

Any help would be highly appreciated.

Thanks for your time.
--KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Android source code not available at official site

2011-10-15 Thread KK
Any mirrors for Android source ?
Thanks in advance.

--KK

On Sat, Oct 15, 2011 at 7:40 AM, Chris  wrote:

> Because open source is here for your amusement..
>
> Trade you my copy of froyo for your copy of honeycomb?  Oh, wait
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android source code not available at official site

2011-10-13 Thread KK
Hi All,
I was trying to download the android source code and play around with
things. I'm trying to use this like
   http://source.android.com/source/downloading.html

to get the source code. It seems the URL is unavailable and the 404 page
comes up . I also tried to access the page manually at @
https://android.git.kernel.org/repo
but the page is not available. Is there any alternative for the same.

Would appreciate if someone can point me in the right direction to get the
(latest)android source code. Thanks a ton.


--KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] In AutoCompleteVeiw calling setAdapter() and setThreshod() gives error

2011-10-07 Thread KK
Thanks Kostya...


2011/10/7 Kostya Vasilyev 

> The compiler is right - your curly braces are not matching up.
>
> The code you highlighted should be inside onCreate, not like it is now.
>
> --
> Kostya Vasilyev
> 07.10.2011 9:04 пользователь "KK"  написал:
>
> > Hi All,
> > I'm trying a sample code available on the web, in which I'm trying to
> test
> > AutoCompleteView. When trying to call setAdapter() method in following
> > lines:
> >
> > * autoCompTxt.setAdapter(arrayAdapter);*
> > * autoCompTxt.setThreshold(3);*
>
> >
> > I'm getting the following errors;
> >
> > *Multiple markers at this line*
> > * - Syntax error on token "arrayAdapter", VariableDeclaratorId expected
> > after *
> > * this token*
> > * - Syntax error on token(s), misplaced construct(s)*
>
> >
> > The code for the main Activity is as below:
> >
> > *package com.demo.autocomp;*
> > *
> > *
> > *import android.app.Activity;*
> > *import android.os.Bundle;*
> > *import android.widget.ArrayAdapter;*
> > *import android.widget.AutoCompleteTextView;*
> > *
> > *
> > *public class AutoCompleteDemoActivity extends Activity {*
> > * private final static String[] presidents = { "Dwight D. Eisenhower",
> "John
> > F. Kennedy",*
> > * "Lyndon B. Johnson", "Richard Nixon", "Gerald Ford",*
> > * "Jimmy Carter", "Ronald Reagan", "George H. W. Bush",*
> > * "Bill Clinton", "George W. Bush", "Barack Obama" };*
> > *
> > *
> > * /** Called when the activity is first created. */*
> > * @Override*
> > * public void onCreate(Bundle savedInstanceState) {*
> > * super.onCreate(savedInstanceState);*
> > * setContentView(R.layout.main);*
> > * }*
> > *
> > *
> > * AutoCompleteTextView autoCompTxt = (AutoCompleteTextView)
> > findViewById(R.id.autoCompleteTextView1);*
> > * ArrayAdapter arrayAdapter = new ArrayAdapter(*
> > * getApplicationContext(),*
> > * android.R.layout.simple_dropdown_item_1line, presidents);*
> > * autoCompTxt.setAdapter(arrayAdapter);*
> > * autoCompTxt.setThreshold(3);*
> > *}*
>
> >
> >
> > The corresponding res/layoute/main.xml is as below(there is no errors in
> > main.xml, just posting for reference purposes):
> >
> > **
> > *http://schemas.android.com/apk/res/android
> "*
> > * android:orientation="vertical" android:layout_width="fill_parent"*
> > * android:layout_height="fill_parent">*
> > *  > * android:layout_height="wrap_content" android:text="@string/president"
> />*
> > *  > * android:id="@+id/autoCompleteTextView1"
> > android:layout_height="wrap_content"*
> > * android:text="AutoCompleteTextView">*
> > * *
> > * *
> > **
>
> >
> > Would appreciate if someone can point me what is wrong here or how to fix
> > the error and make the code work.
> >
> > Thanks,
> > KK
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/android-developers?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] In AutoCompleteVeiw calling setAdapter() and setThreshod() gives error

2011-10-06 Thread KK
Hi All,
I'm trying a sample code available on the web, in which I'm trying to test
AutoCompleteView. When trying to call setAdapter() method in following
lines:

*autoCompTxt.setAdapter(arrayAdapter);*
* autoCompTxt.setThreshold(3);*

I'm getting the following errors;

*Multiple markers at this line*
* - Syntax error on token "arrayAdapter", VariableDeclaratorId expected
after *
* this token*
* - Syntax error on token(s), misplaced construct(s)*

The code for the main Activity is as below:

*package com.demo.autocomp;*
*
*
*import android.app.Activity;*
*import android.os.Bundle;*
*import android.widget.ArrayAdapter;*
*import android.widget.AutoCompleteTextView;*
*
*
*public class AutoCompleteDemoActivity extends Activity {*
* private final static String[] presidents = { "Dwight D. Eisenhower", "John
F. Kennedy",*
* "Lyndon B. Johnson", "Richard Nixon", "Gerald Ford",*
* "Jimmy Carter", "Ronald Reagan", "George H. W. Bush",*
* "Bill Clinton", "George W. Bush", "Barack Obama" };*
*
*
* /** Called when the activity is first created. */*
* @Override*
* public void onCreate(Bundle savedInstanceState) {*
* super.onCreate(savedInstanceState);*
* setContentView(R.layout.main);*
* }*
*
*
* AutoCompleteTextView autoCompTxt = (AutoCompleteTextView)
findViewById(R.id.autoCompleteTextView1);*
* ArrayAdapter arrayAdapter = new ArrayAdapter(*
* getApplicationContext(),*
* android.R.layout.simple_dropdown_item_1line, presidents);*
* autoCompTxt.setAdapter(arrayAdapter);*
* autoCompTxt.setThreshold(3);*
*}*


The corresponding res/layoute/main.xml is as below(there is no errors in
main.xml, just posting for reference purposes):

**
*http://schemas.android.com/apk/res/android"*
* android:orientation="vertical" android:layout_width="fill_parent"*
* android:layout_height="fill_parent">*
* *
* *
* *
* *
**

Would appreciate if someone can point me what is wrong here or how to fix
the error and make the code work.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: OnCheckedChangeListener not working on RadioGroup

2011-10-06 Thread KK
I got it!. during creating the oncheckedchangelistener(), specifying
"new  RadioGroup.OnCheckedChangeListener()" instead of
just  "OnCheckedChangeListener()" fixed the problem.

Adding the sample code for others reference.

RadioGroup rdGroup = (RadioGroup) findViewById(R.id.rdbGp1);
rdGroup.setOnCheckedChangeListener(*new RadioGroup.OnCheckedChangeListener()
* {

@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
 // TODO Auto-generated method stub

}
});


Thanks to all of you.

--KK

On Thu, Oct 6, 2011 at 8:54 PM, KK  wrote:

> Would appreciate if someone could explicitly mention what exactly is
> the fix for this error. As, I don't see any mention of compoundbutton
> and the user has correctly used  RadioGroup.OnCheckedChangeListener
> I'm stuck at the same point.
>
> Thanks
>
> On Aug 12, 3:58 pm, Mark Murphy  wrote:
> > The error message is self-explanatory. You are trying to use
> > a CompoundButton.OnCheckedChangeListener() in a place that takes
> > a RadioGroup.OnCheckedChangeListener.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Fri, Aug 12, 2011 at 12:58 AM, shamir shakir 
> wrote:
> > > Hello,
> > > I was trying to add the CheckedChangeListner for RadioGroup and it's
> not
> > > working ... :(
> > > I'm using eclipse IDE. And I'm getting this error
> >
> > > The method
> setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener)
> > >> in the type RadioGroup is not applicable for the arguments (new
> > >> CompoundButton.OnCheckedChangeListener(){})
> >
> > > Here's the code
> >
> > > package com.dewsworld.android.practise;
> >
> > > import java.util.Date;
> >
> > > import android.app.Activity;
> > > import android.content.Intent;
> > > import android.content.res.Resources.Theme;
> > > import android.graphics.drawable.GradientDrawable.Orientation;
> > > import android.os.Bundle;
> > > import android.os.Process;
> > > import android.provider.ContactsContract;
> > > import android.util.Log;
> > > import android.view.View;
> > > import android.view.View.OnClickListener;
> > > import android.widget.AutoCompleteTextView;
> > > import android.widget.Button;
> > > import android.widget.CheckBox;
> > > import android.widget.Checkable;
> > > import android.widget.CompoundButton;
> > > import android.widget.CompoundButton.OnCheckedChangeListener;
> > > import android.widget.EditText;
> > > import android.widget.Gallery;
> > > import android.widget.LinearLayout;
> > > import android.widget.ProgressBar;
> > > import android.widget.QuickContactBadge;
> > > import android.widget.RadioGroup;
> > > import android.widget.TextView;
> > > import android.widget.Toast;
> > > import android.widget.ToggleButton;
> > > import android.widget.SimpleAdapter.ViewBinder;
> >
> > > public class EntryPointActivity extends Activity {
> > >  @Override
> > >  protected void onCreate(Bundle savedInstanceState) {
> > >  super.onCreate(savedInstanceState);
> > >  setContentView(R.layout.main) ;
> > >  RadioGroup radioGroup = (RadioGroup)this.findViewById(R.id.rg) ;
> > >  radioGroup.setOnCheckedChangeListener( new OnCheckedChangeListener() {
> > >   @Override
> > >  public void onCheckedChanged(RadioGroup group, int checkedId) {
> > >  // ... :(
> > >  }
> > >  });
> > >  }
> > > }
> >
> > > Any kind of help is much more appreciated. Thanks
> >
> > > --
> >
> > >* Shamir Shakir*
> > > L-2, T-2, Grad. Student, B. Sc., Dept. of CSE,
> > > Military Institute of Science and Technology (MIST),
> > > Mirpur Cantonment, Dhaka, Bangladesh.
> >
> > >www.dewsworld.info| dewswo...@gmail.com
> >
> > >  --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to
> android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.co

[android-developers] Re: OnCheckedChangeListener not working on RadioGroup

2011-10-06 Thread KK
Would appreciate if someone could explicitly mention what exactly is
the fix for this error. As, I don't see any mention of compoundbutton
and the user has correctly used  RadioGroup.OnCheckedChangeListener
I'm stuck at the same point.

Thanks

On Aug 12, 3:58 pm, Mark Murphy  wrote:
> The error message is self-explanatory. You are trying to use
> a CompoundButton.OnCheckedChangeListener() in a place that takes
> a RadioGroup.OnCheckedChangeListener.
>
>
>
>
>
>
>
>
>
> On Fri, Aug 12, 2011 at 12:58 AM, shamir shakir  wrote:
> > Hello,
> > I was trying to add the CheckedChangeListner for RadioGroup and it's not
> > working ... :(
> > I'm using eclipse IDE. And I'm getting this error
>
> > The method setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener)
> >> in the type RadioGroup is not applicable for the arguments (new
> >> CompoundButton.OnCheckedChangeListener(){})
>
> > Here's the code
>
> > package com.dewsworld.android.practise;
>
> > import java.util.Date;
>
> > import android.app.Activity;
> > import android.content.Intent;
> > import android.content.res.Resources.Theme;
> > import android.graphics.drawable.GradientDrawable.Orientation;
> > import android.os.Bundle;
> > import android.os.Process;
> > import android.provider.ContactsContract;
> > import android.util.Log;
> > import android.view.View;
> > import android.view.View.OnClickListener;
> > import android.widget.AutoCompleteTextView;
> > import android.widget.Button;
> > import android.widget.CheckBox;
> > import android.widget.Checkable;
> > import android.widget.CompoundButton;
> > import android.widget.CompoundButton.OnCheckedChangeListener;
> > import android.widget.EditText;
> > import android.widget.Gallery;
> > import android.widget.LinearLayout;
> > import android.widget.ProgressBar;
> > import android.widget.QuickContactBadge;
> > import android.widget.RadioGroup;
> > import android.widget.TextView;
> > import android.widget.Toast;
> > import android.widget.ToggleButton;
> > import android.widget.SimpleAdapter.ViewBinder;
>
> > public class EntryPointActivity extends Activity {
> >  @Override
> >  protected void onCreate(Bundle savedInstanceState) {
> >  super.onCreate(savedInstanceState);
> >  setContentView(R.layout.main) ;
> >  RadioGroup radioGroup = (RadioGroup)this.findViewById(R.id.rg) ;
> >  radioGroup.setOnCheckedChangeListener( new OnCheckedChangeListener() {
> >   @Override
> >  public void onCheckedChanged(RadioGroup group, int checkedId) {
> >  // ... :(
> >  }
> >  });
> >  }
> > }
>
> > Any kind of help is much more appreciated. Thanks
>
> > --
>
> >        * Shamir Shakir*
> >         L-2, T-2, Grad. Student, B. Sc., Dept. of CSE,
> >         Military Institute of Science and Technology (MIST),
> >         Mirpur Cantonment, Dhaka, Bangladesh.
>
> >        www.dewsworld.info| dewswo...@gmail.com
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.0
> Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] ListView Row not firing the click event

2011-10-06 Thread KK
What exactly is the error message you are getting?

--KK

On Thu, Oct 6, 2011 at 3:46 PM, Naveen  wrote:

> i am using custom list , it's
> l1.setAdapter(new EfficientAdapter(this));
>
>l1.setFocusable(true);
>l1.setClickable(true);
>l1.setOnItemClickListener(new OnItemClickListener() {
>@Override
>public void onItemClick(AdapterView adapter, View
> view,  int pos, long id) {
>Log.i("listview", "clicked1");
>
>Toast.makeText(getApplicationContext(),
>"Child ItemClicked " + pos ,
>Toast.LENGTH_SHORT).show();
>
>}
>});
>
>
>
> it's not working
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Trying to play around with ContentResolver, but stuck with weird issue

2011-10-01 Thread KK
Hi Kostya,
Thank you very much, You're a life saver !

Thanks,
KK

On Sat, Oct 1, 2011 at 8:59 PM, Kostya Vasilyev  wrote:

> Take out this:
>
> 01.10.2011 19:26, KK пишет:
>
>>
>> import android.R;
>>
>
> Then press Ctrl+Shift+O to "resolve imports", and choose your project's R
> file this time.
>
> --
> Kostya Vasilyev
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to 
> android-developers@**googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+**unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/**group/android-developers?hl=en<http://groups.google.com/group/android-developers?hl=en>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Trying to play around with ContentResolver, but stuck with weird issue

2011-10-01 Thread KK
Hi All,
I just copied this code from the web and trying to run it in Eclipse gives
me errors, the R.id.listView and R.layout.main are not getting resolved. No
idea whats going wrong here.
Please find the code for Java and mail.xml file as below:
---MyContentResolver .java
file is below:
package com.sailo.contentresolverdemo;

import java.util.ArrayList;

import android.R;
import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.ContactsContract.PhoneLookup;
import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MyContentResolver extends Activity {
 private static final String TAG = "MyContentResolver";
private ArrayList list;

/** Called when the activity is first created. */
@Override
 public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 setContentView(R.layout.main);

// Get content provider and cursor
 ContentResolver r = getContentResolver();
Cursor cursor = r.query(ContactsContract.Contacts.CONTENT_URI, null,
 null, null, null);

// Let activity manage the cursor
startManagingCursor(cursor);
 Log.d(TAG, "cursor.getCount()=" + cursor.getCount());

// Get value from content provider
 int nameIndex = cursor.getColumnIndexOrThrow(PhoneLookup.DISPLAY_NAME);
int numberIndex = cursor
 .getColumnIndexOrThrow(ContactsContract.CommonDataKinds.Phone.NUMBER);

cursor.moveToFirst();
 list = new ArrayList();
do {
String name = cursor.getString(nameIndex);
 String number = cursor.getString(numberIndex);
list.add(name + ": " + number);
 } while (cursor.moveToNext());

// Get the list view
ListView listView = (ListView) findViewById(R.id.listView);
 ArrayAdapter aa = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, list);
 listView.setAdapter(aa);
}
}

 main.xml is given
below:

http://schemas.android.com/apk/res/android";
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>



-------



Thanks in advance.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: How to capture sensor moves using SensorSimulator

2011-09-29 Thread KK
Thanks for your response.
Is there any documentation on the web that contains some of the
parameters(already tuned to some extent) that I can try with. For instance I
found couple of examples talking about shake and there is a mention of:
(accelationSquareRoot >= 2) means shake detected,
This is the complete code for this:

public void onSensorChanged(SensorEvent event) {
// TODO
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
 float[] values = event.values;
// Movement
float x = values[0];
 float y = values[1];
float z = values[2];

float accelationSquareRoot = (x * x + y * y + z * z)
 / (SensorManager.GRAVITY_EARTH * SensorManager.GRAVITY_EARTH);
long actualTime = System.currentTimeMillis();
 if (accelationSquareRoot >= 2) //
{
if (actualTime - lastUpdate < 200) {
 return;
}
lastUpdate = actualTime;
 // Shake Detected
// TODO: do something
 }

}
}

Thanks in advance.

Regards,
KK

On Thu, Sep 29, 2011 at 10:46 PM, ColorTheorist <
colortheorydevelo...@gmail.com> wrote:

> You'll have to use the sensormanager class and use thresholds as you
> have mentioned at the lowest level by subscribing to the
> accelerometer. From there you should be able to do what you want. If
> there are nice libraries that will do mathematical calculations that
> often accompany these readings I do not know of one.  Similar readings
> for orientation for tilt can be done with the sensormanager.
>
> On Sep 29, 12:08 am, KK  wrote:
> > Hi All,
> > Can someone explain about how to capture a particular movement, meaning
> > there must be some mechanism to capture the changes in X,Y and Z
> > co-ordinates and other things calculate the corresponding acceleration
> etc
> > and then set the threshold for your required shake/move. If I want to try
> a
> > new shake, how to do I set the threshold value, what is the usual
> process?
> >
> > I was wondering, is there any way we can use enable SensorSimulator and
> let
> > it capture all the sensor parameters during shake/move and then pick
> those
> > recorded values and set your threshold. I think this must
> > be repetitive process, if someone wants to tune the threshold value.
> Would
> > appreciate if someone can throw some light on this.
> >
> > Thanks,
> > KK
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to capture sensor moves using SensorSimulator

2011-09-28 Thread KK
Hi All,
Can someone explain about how to capture a particular movement, meaning
there must be some mechanism to capture the changes in X,Y and Z
co-ordinates and other things calculate the corresponding acceleration etc
and then set the threshold for your required shake/move. If I want to try a
new shake, how to do I set the threshold value, what is the usual process?

I was wondering, is there any way we can use enable SensorSimulator and let
it capture all the sensor parameters during shake/move and then pick those
recorded values and set your threshold. I think this must
be repetitive process, if someone wants to tune the threshold value. Would
appreciate if someone can throw some light on this.


Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: how to play media files(mp3) with some missing metadata

2011-09-27 Thread KK
Hi,
In this regard, I was just thinking, if I can somehow map the
MediaStore.Audio.Media.TITLE
to its corresponding absolute path, I should be able to play it without
issues(my earlier version of playSong() method was doing just that), but I'm
not yet to find a way to do that. Would appreciate if someone can point me
in the right direction.

Thanks,
KK

On Tue, Sep 27, 2011 at 9:47 PM, KK  wrote:

> Hi All,
> As part of my basic mp3 player, I'm using the inbuilt media player to play
> songs. The problem I'm facing is that, though I'm able to get "TITLE" but
> during playing the song, when I query for "DATA" field as below ( the full
> code for quick viewing is give below.)
>
> *private void playSong(int position) {*
> * try {*
> * int column_index = mCursor*
> * .getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);*
> * mCursor.moveToPosition(position);*
> * String filename = mCursor.getString(column_index);*
> * Log.v(TAG, "Current Title:" + mCursor.getString(column_index));*
> * if (mp.isPlaying()) {*
> * mp.reset();*
> * }*
> * mp.setDataSource(filename);*
> * mp.prepare();*
> * mp.setOnCompletionListener(new OnCompletionListener() {*
> * // Setup listener so next song starts automatically*
> * @Override*
> * public void onCompletion(MediaPlayer arg0) {*
> * nextSong();*
> * }*
> * });*
> * mp.start();*
> * } catch (Exception e) {*
> * Log.e(TAG, "Exception in playsong():" + e.getMessage());*
> * }*
> * }*
>
> its giving me the following errors:
> 09-27 21:29:30.980: ERROR/Mp3Player(633): Exception in playsong():*column
> '_data' does not exist*
>
> Is there any way, I can get around with this and still play these mp3
> files. The mp3 files I'm using are the ones commonly available on the web
> and might be missing the metadata.
>
> Any help would be appreciated.
>
> Thanks,
> KK
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to play media files(mp3) with some missing metadata

2011-09-27 Thread KK
Hi All,
As part of my basic mp3 player, I'm using the inbuilt media player to play
songs. The problem I'm facing is that, though I'm able to get "TITLE" but
during playing the song, when I query for "DATA" field as below ( the full
code for quick viewing is give below.)

*private void playSong(int position) {*
* try {*
* int column_index = mCursor*
* .getColumnIndexOrThrow(MediaStore.Audio.Media.DATA);*
* mCursor.moveToPosition(position);*
* String filename = mCursor.getString(column_index);*
* Log.v(TAG, "Current Title:" + mCursor.getString(column_index));*
* if (mp.isPlaying()) {*
* mp.reset();*
* }*
* mp.setDataSource(filename);*
* mp.prepare();*
* mp.setOnCompletionListener(new OnCompletionListener() {*
* // Setup listener so next song starts automatically*
* @Override*
* public void onCompletion(MediaPlayer arg0) {*
* nextSong();*
* }*
* });*
* mp.start();*
* } catch (Exception e) {*
* Log.e(TAG, "Exception in playsong():" + e.getMessage());*
* }*
* }*

its giving me the following errors:
09-27 21:29:30.980: ERROR/Mp3Player(633): Exception in playsong():*column
'_data' does not exist*

Is there any way, I can get around with this and still play these mp3 files.
The mp3 files I'm using are the ones commonly available on the web and might
be missing the metadata.

Any help would be appreciated.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: how to play streaming media on android

2011-09-27 Thread KK
Thanks Mort. Please let me know if you have some web links about the
ShoutCast support. I'll also check it in google.

Thanks,
KK

On Tue, Sep 27, 2011 at 6:40 PM, mort  wrote:

> If your device isn't too buggy to do it (which isn't that rare...),
> simply pass the URL instead of the file name
> (setDataSource("http://...";)).
> And you should do MediaPlayer.prepare() in its own thread, otherwise
> establishing the connection and buffering might end with an ANR.
> If you need a way that really works on all devices (at least with ARM
> processor...), or more than simple MP3 file streaming (e.g. ShoutCast
> support), you need to look for a library that works for you,
> MediaPlayer won't do.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to play streaming media on android

2011-09-27 Thread KK
I'm working on creating a basic streaming media player, where in user can
customize URLs for online audio stream and play it.In this regard I need
some help as I dont know how to play streaming media, though I 'm able to
play media files(tried with mp3 files) on local storage(sdcard).

Any pointers would be highly appreciated.

Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Creating PNG images for app startup, background etc

2011-09-26 Thread KK
Hi Chris,
Thanks for the links. I'm going to spend some time learning more about using
GIMP utility to help me creating basic splash images, background images
etc.

Thanks,
KK

On Tue, Sep 27, 2011 at 8:44 AM, Chris  wrote:

>
>
> On Sunday, September 25, 2011 8:32:50 AM UTC-4, KK wrote:
>>
>> Hi All,
>>  Can someone point me to some tutorial or help me on how to create these
>> PNG images with ease.
>>
>
> The Android Icon Design Guidelines, here (
> http://developer.android.com/guide/practices/ui_guidelines/icon_design.html)
> and the official Gimp tutorials page (http://www.gimp.org/tutorials/)
> should have enough info to get you started.  If you have specific questions,
> please follow up.
>
> Other Google searches like "png jpg conversion" and the like should help,
> too.  If you come across any Android-specific difficulties, again, follow
> up.
>
> Thanks.
> - C
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Creating PNG images for app startup, background etc

2011-09-26 Thread KK
Hi Oli,
Can you elaborate a bit on how to get a PNG exported from a scene or how to
convert some image say in JPEG format to PNG and then put that in proper
dimension and size. Can you point us to some tutorial links?
Thanks in advance.

Thanks,
KK

On Mon, Sep 26, 2011 at 2:35 PM, Oli  wrote:

> I'll give another thumbs up for using Inkscape.  I played around
> recently writing a small game and used it for most of the art assets
> (buttons, logos, etc.).  I found it's particularly handy if you're
> going to want to output multiple sizes of the same artwork without any
> loss in quality.
>
> http://floor4.co.uk/2011/09/16/creating-artwork-for-developers/
>
> Another thing worth looking at if you want to do something a little
> more complex might be Blender.  It's fairly simple to get a png export
> of a 3D scene.  Obviously there's a bit more of a learning curve to
> get the scene created in the first place, but I found it invaluable as
> a non-artist - no need to consider stuff like shading as I could just
> let the lighting do it for me :)
>
> On Sep 25, 6:43 pm, Vishal  wrote:
> > HI,
> > I am in the same situation. I have been searching for a while and got
> > to know that a SVG (http://en.wikipedia.org/wiki/
> > Scalable_Vector_Graphics) editor is good to create your logos etc..
> > I just downloaded Inkscape (free) and am playing around a bit. Hope
> > someone experienced can write more
> > Thanks
> >
> > On Sep 25, 5:32 pm, KK  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi All,
> > > I'm finding it difficult to get a PNG image of required size(and other
> > > parameters) that I can use during app start and may be also for the app
> > > background. Can someone point me to some tutorial or help me on how to
> > > create these PNG images with ease. I tried downloading some images(PNG
> ones
> > > only with 320x480 size) from the web but it dint' work, it me errors
> saying
> > > not a PNG image, wrong format etc..
> >
> > > Any help would be appreciated.
> >
> > > Thanks,
> > > kk
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] how to recursively search for media(mp3) files in sdcard

2011-09-26 Thread KK
Thanks for your quick reply Mark. I tried to search on "how to use
Mediastore" and found one similar item here @
http://stackoverflow.com/questions/6208315/in-android-how-do-i-query-mediastore-only-for-files-in-a-specific-path-or-alter

Would appreciate, if you could point me to some working sample code.

Thanks,
KK

On Tue, Sep 27, 2011 at 12:19 AM, Mark Murphy wrote:

> On Mon, Sep 26, 2011 at 2:44 PM, KK  wrote:
> > I'm trying to write some simple method to recursively
> > crawl the sdcard in all foders and create a list of all mp3 files, which
> I
> > can make use of later for playing the same.
>
> This has already been done by the OS. Query the MediaStore content
> provider to find MP3 files available to the user on external storage.
> This also will handle situations where there are files that should not
> be in a music player (e.g., audiobook files).
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to recursively search for media(mp3) files in sdcard

2011-09-26 Thread KK
Hi All,
This is related to a sample media player I'm write as part of learning more
of Android. For this, I'm trying to write some simple method to recursively
crawl the sdcard in all foders and create a list of all mp3 files, which I
can make use of later for playing the same. I tried google to find some
efficient way to do the same, but found that most of them are suggesting
having your own recursive method to the same. I also bumped into this URL @
http://stackoverflow.com/questions/3289649/recursively-add-files-in-java-speed-issue
but
don't know how to use the idea presented therein in a efficient wayy. Would
appreciate if someone could help me getting this. Any working example for
the same would be very helpful.

Thank you.
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: How to use SensorSimulator @ http://code.google.com/p/openintents/wiki/SensorSimulator

2011-09-25 Thread KK
Hi Adam,
Thanks for the quick help. You are right, once I changed the mSensorManager
to be an instance of SensorManagerSimulator, it worked like a charm.
Thank you.

--KK

On Sun, Sep 25, 2011 at 7:16 PM, Adam Ratana  wrote:

> It's been a long time since I've used this, but iirc, you do have to make
> some modifications to your existing code to get this to work (in addition to
> what you've already done), so your mSensorManager must be an instance of
> SensorManagerSimulator, instead of SensorManager, for instance.  This is a
> great tool for testing Sensor events so it is worth the slight effort to set
> it up.
>
>
> On Saturday, September 24, 2011 11:58:16 PM UTC-4, KK wrote:
>>
>> Hi All,
>> Can someone help me on how to use the SensorSimulator @
>> http://code.google.com/p/**openintents/wiki/**SensorSimulator<http://code.google.com/p/openintents/wiki/SensorSimulator>
>> I went through the instructions at the above wiki page, regarding
>> adding/using the SensorEventListeners and other Sensor related classes from
>> this package, but when I tried this :
>>
>>- Replace the following code in onCreate():
>>
>>mSensorManager = (SensorManager) getSystemService(SENSOR_**SERVICE);
>>
>>- by this code
>>
>>mSensorManager = SensorManagerSimulator.getSyst**emService(this, 
>> SENSOR_SERVICE);
>>
>>
>>
>> I'm getting error messages saying:
>> Type mismatch: cannot convert from SensorManagerSimulator to
>> SensorManager
>>
>> Also for the registerListener() and unreigsterListener(), I'm getting this
>> error:
>>  The method unregisterListener(**SensorListener) in the type
>> SensorManager is not applicable for the arguments (ShakeActivity)   // My
>> Activity is named ShakeActivity
>>
>> Can someone help me how to fix these errors and use the SensorSimulator to
>> simulates movements/shakes etc.
>>
>> Thanks in advance.
>>
>> --KK
>>
>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Creating PNG images for app startup, background etc

2011-09-25 Thread KK
Hi All,
I'm finding it difficult to get a PNG image of required size(and other
parameters) that I can use during app start and may be also for the app
background. Can someone point me to some tutorial or help me on how to
create these PNG images with ease. I tried downloading some images(PNG ones
only with 320x480 size) from the web but it dint' work, it me errors saying
not a PNG image, wrong format etc..

Any help would be appreciated.


Thanks,
kk

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How to use SensorSimulator @ http://code.google.com/p/openintents/wiki/SensorSimulator

2011-09-24 Thread KK
Hi All,
Can someone help me on how to use the SensorSimulator @
http://code.google.com/p/openintents/wiki/SensorSimulator
I went through the instructions at the above wiki page, regarding
adding/using the SensorEventListeners and other Sensor related classes from
this package, but when I tried this :

   - Replace the following code in onCreate():

   mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);

   - by this code

   mSensorManager = SensorManagerSimulator.getSystemService(this,
SENSOR_SERVICE);



I'm getting error messages saying:
Type mismatch: cannot convert from SensorManagerSimulator to
SensorManager

Also for the registerListener() and unreigsterListener(), I'm getting this
error:
 The method unregisterListener(SensorListener) in the type SensorManager
is not applicable for the arguments (ShakeActivity)   // My Activity is
named ShakeActivity

Can someone help me how to fix these errors and use the SensorSimulator to
simulates movements/shakes etc.

Thanks in advance.

--KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] how to show numbers before each string in ListView

2011-09-22 Thread KK
Hi All,
I'm just trying to list song items and displaying it to user for selection.
I'm using the following ListView for this purposes:



and this list down the songs like this:
songa
songb
songc

Is there any option maybe shomething like android:numericlist which will
list the songs like this:
1.songa
2.songb
3.songc

Or may be some other elegant yet simple way to achieve the same effect.

Any help would be highly appreciated.


Thanks,
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How does Android EditText store the content internally

2011-08-27 Thread KK
Hi,

  I have an android EditText which holds a password. I have to
retrieve this in one of my modules and pass it to another. I am
calling EditText.getEditableText and encrypting its content. But I
want to know if android creates any immutable objects internally for
the EdiText Content(like String), in which case there might still be a
way for a hacker to get the password out?

Thanks
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Button in Custom Preference gets enabled automatically

2011-08-25 Thread KK
I have a custom preference in my application which consists of a
textview and a button and it is put in a preference screen. I load the
layout in the onCreateView of the preference

LayoutInflater inflater =  (LayoutInflater)getContext().
 
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.custom_preference, parent,
false);

In my xml, I have put android:enabled="false" for the button because I
want to disable it and enable it conditionally later. When my
preferencescreen comes up, this button is disabled, but gets enabled
automatically in a second(I still haven't added any code to enable
this yet).

Also I find that the onCreateView of my custom preference keeps
getting called again and again.

Can someone please help me as to what is happening here?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How does android decide to cache a process?

2011-08-04 Thread KK
In Gingerbread Settings->Applications->MyApplications, the Running tab
has been divided into two. Running Services and Cached Background
Process. So how and when does Android decide to cache a process?
Mainly is there anything my app can do to tell the system to never
cache my process?

Thanks
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Rendering 24 bit RGB using Android Bitmap

2010-12-09 Thread KK
Hi,

  Is there anyway I can render a 24 bit RGB using Android Bitmap
class? The Bitmap.Config does not seem to have a 24 bit option. Is
there anyway to do this?

Thanks in advance
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] ServerManagedPolicy not working as expected - getting many "This app is not licensed" responses.

2010-11-22 Thread kk
Hi all,

I've implemented the ServerManagedPolicy based on the sample in the
LVL libs.
My understanding was that it's much more flexible comparing to the
StringPolicy in the it  caches responses and it
doesn't always need to check.

In my dev panel I have the settings for my app returning LICENSED all
the time. This works quite a few of the times
but when I don't have signal (e.g. when I'm on the tube/underground) I
get:

com.android.vending.AsynchRequestRunner$1.runRequestRetrying
Failure(): Got IOException from async request: Host is unresolved:
android.clients.google.com:80

Am I missing something? Do I need to tweak any settings regarding the
caching?
I'm playing the game - all is fine. 5 minutes later I'm somewhere
without a signal and I get the "App is not licensed" dialog.
How soon does the caching "expire"?

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-17 Thread kk
George,

Is it meant to alloc every time you call it then?
That's going to cause GC to collect at random times during my game :(

cheers,
kk

On Nov 15, 4:40 pm, george barber  wrote:
> no your not using it wrong
>
>
>
> On Mon, Nov 15, 2010 at 4:37 PM, kk  wrote:
> > Just to make sure, can someone please tell me if I'm misusing
> > StringBuilder here.
> > This is what I do:
>
> > private StringBuilder m_healthString = new StringBuilder(8);
>
> > I update by doing:
> > m_healthString.replace(0, 8, Integer.toString(myHealth));
> > Is this expensive/wrong? Is there a better way to update a
> > StringBuilder with a new String?
>
> > I render by doing:
>
> > myCanvas.drawText(m_healthString, ...); // this is using the char[]
> > version, which is good
>
> > Obviously I will look into a custom version of Integer.toString, which
> > will
> > eliminate quite a lot of the allocations in there.
>
> > cheers,
> > kk.
>
> > On Nov 15, 1:17 pm, Kostya Vasilyev  wrote:
> > > SetBounds has a version that takes four integers - no "new Rect" is
> > > necessary.
>
> > > As for Integer.toString - it's easy enough to write your own version
> > > that outputs the result into a supplied "char[]" buffer, that's only
> > > allocated once. Canvas.drawText() has a version that takes char[].
>
> > > But I suspect it's something else. Why are you calling System.gc, if
> > > you've gone to great lengths to minimize memory allocations? Perhaps
> > > you're calling it too much?
>
> > > -- Kostya
>
> > > 15.11.2010 16:09, kk пишет:
>
> > > > DanH,
>
> > > > I've had a look at the allocations using DDMS. The only things that
> > > > are being allocated during the game (that I have control over) are
> > > > Integer.toString and Drawable.setBounds calls.
>
> > > > Also, I calling System.gc() periodically and it logs the time taken
> > > > to do the collection...It doesn't seem to be increasing with time.
>
> > > > I'll try profiling as suggested by Dianne but this is very weird and
> > > > is holding up my release :(
>
> > > > cheers,
> > > > kk.
>
> > > > On Nov 15, 1:59 am, DanH  wrote:
> > > >> My guess is that you have a slow memory leak, and GC is taking more
> > > >> and more time (and happening more frequently) as the garbage builds
> > > >> up.  You need some traces and profiling to figure out what's going on.
>
> > > >> On Nov 14, 12:54 pm, kk  wrote:
>
> > > >>> Hi all,
> > > >>> I've written a game and I've noticed that after playing for about
> > > >>> 20-30 minutes the performance starts degrading.
> > > >>> By performance degradation I mean my average frames-per-second seem
> > to
> > > >>> slowly drop.
> > > >>> I've no idea what could be causing this so any help would be greatly
> > > >>> appreciated.
> > > >>> I'm doing all my allocs at the beginning and the only things that
> > > >>> alloc in game according to DDMS are
> > > >>> Integer.toString operations (for integer values I need to draw with
> > > >>> drawtext) and setBounds on some drawables.
> > > >>> (I've no idea how to stop these from happening, so again, if you know
> > > >>> a way around this please do tell).
> > > >>> I'm calling System.gc() periodically, when I know not much is going
> > on
> > > >>> in-game (e.g. between waves of enemies).
> > > >>> I'm doing this in order to avoid GC from happening during critical
> > > >>> gameplay periods.
> > > >>> If you know the answer to any of the following, please do tell (even
> > a
> > > >>> guess would do :)):
> > > >>> + Why is performance degrading with time? What could be causing this?
> > > >>> + Is there a way to avoid allocs due to Integer.toString and
> > > >>> Drawable.setBounds calls?
> > > >>> Thank you in advance,
> > > >>> kk.
>
> > > --
> > > Kostya Vasilyev -- WiFi Manager + pretty widget --
> >http://kmansoft.wordpress.com
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Can I stop background apps from causing GC and eating up CPU?

2010-11-17 Thread kk
Hi all,

In looking at some performance issues for a game I'm developing I came
across some interesting facts.
Although I've minimised GC caused by my app, other apps can still
cause one.
Also, during framerate drops in my game, I've noticed things like the
weather service, email checked, etc.
going nuts in the background. (This is on Android 1.6).

I don't really want to block incoming calls, i.e. go into flight mode,
before the game starts.
I think it's important for the game to be interrupted if there's an
incoming call.
However, while playing, I don't think people care about weather
updates, email updates, texts, etc.

Is there an interface that will let me control what is "active" in the
background and what should be "suspended"?

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-16 Thread kk
Hi all,

Got rid of all the Integer.toString allocations by having my own
intToString method and using char[] as suggested.
The only thing showing now on the DDMS allocs are the
Drawable.setBounds calls (lots of them).
I've used both the rect version and the four-ints version of setBounds
but they both do the same thing.
I'll post some code in case someone can tell me what I'm doing wrong:

private AnimationDrawable m_animationDrawable;
m_animationDrawable = (AnimationDrawable)
m_inGameView.getResources().getDrawable(p_animDrawableID);

then my doDraw method looks like:
final void doDraw(final Canvas p_canvas, final Rect p_bbox, final
boolean p_applyColorFilter)

and it does the following:
m_animationDrawable.getFrame(m_currentFrame).setBounds(p_bbox.left,
p_bbox.top, p_bbox.right, p_bbox.bottom);
// some color filter stuff that's irrelevant to the leak go here
m_animationDrawable.getFrame(m_currentFrame).draw(p_canvas);

// m_currentFrame gets updated in doUpdate
// p_bbox is a rect that represents the drawable's bounding
box...different frames can have different bbox sizes (e.g. during an
explosion)

The call to setBounds above shows as an alloc in DDMS :(
I've called it passing p_bbox directly as well (i.e. the rect version
of setBounds) and it makes no difference.
How can I prevent the allocation there?

Thank you in advance,
kk.

On Nov 15, 8:37 pm, kk  wrote:
> Top stuff Kostya/Dianne. Thank you for the feedback.
> I think before I look into anything else, I should do this first to
> get
> rid of the thousands of micro-allocations that take place there.
>
> UI elements are drawn about 20 times per second and although I cache
> values that don't change, a lot of the values do change quite
> frequently.
>
> I'll report back if I'm still having issues after I do this.
>
> Thanx again,
> kk.
>
> On Nov 15, 7:31 pm, Kostya Vasilyev  wrote:
>
>
>
>
>
>
>
> > What I was suggesting was, rather than using Integer.toString(), or any
> > other String / StringBulider methods, format the value yourself.
>
> > In class declaration:
>
> > char[] mMyHealthStr = new char[8];
> > int mMyHealthLen = 0;
>
> > When drawing:
>
> > // convert integer to string in mMyHealthStr, set mMyHealthLen
>
> > canvas.draw(mMyHealthStr, 0, mMyHealthLen, . blah blah .);
>
> > -- Kostya
>
> > 15.11.2010 21:48, Dianne Hackborn ?:
>
> > > On Mon, Nov 15, 2010 at 8:37 AM, kk  > > <mailto:kkostia...@gmail.com>> wrote:
>
> > >     private StringBuilder m_healthString = new StringBuilder(8);
> > >      I update by doing:
> > >     m_healthString.replace(0, 8, Integer.toString(myHealth));
> > >     Is this expensive/wrong? Is there a better way to update a
> > >     StringBuilder with a new String?
>
> > > You haven't gained anything here, because Integer.toString() has
> > > already had to make a string for that integer before you even get in
> > > to the StringBuilder.
>
> > > --
> > > Dianne Hackborn
> > > Android framework engineer
> > > hack...@android.com <mailto:hack...@android.com>
>
> > > Note: please don't send private questions to me, as I don't have time
> > > to provide private support, and so won't reply to such e-mails.  All
> > > such questions should be posted on public forums, where I and others
> > > can see and answer them.
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Kostya Vasilyev -- WiFi Manager + pretty widget 
> > --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-15 Thread kk
Top stuff Kostya/Dianne. Thank you for the feedback.
I think before I look into anything else, I should do this first to
get
rid of the thousands of micro-allocations that take place there.

UI elements are drawn about 20 times per second and although I cache
values that don't change, a lot of the values do change quite
frequently.

I'll report back if I'm still having issues after I do this.

Thanx again,
kk.

On Nov 15, 7:31 pm, Kostya Vasilyev  wrote:
> What I was suggesting was, rather than using Integer.toString(), or any
> other String / StringBulider methods, format the value yourself.
>
> In class declaration:
>
> char[] mMyHealthStr = new char[8];
> int mMyHealthLen = 0;
>
> When drawing:
>
> // convert integer to string in mMyHealthStr, set mMyHealthLen
>
> canvas.draw(mMyHealthStr, 0, mMyHealthLen, . blah blah .);
>
> -- Kostya
>
> 15.11.2010 21:48, Dianne Hackborn ?:
>
>
>
>
>
>
>
>
>
> > On Mon, Nov 15, 2010 at 8:37 AM, kk  > <mailto:kkostia...@gmail.com>> wrote:
>
> >     private StringBuilder m_healthString = new StringBuilder(8);
> >      I update by doing:
> >     m_healthString.replace(0, 8, Integer.toString(myHealth));
> >     Is this expensive/wrong? Is there a better way to update a
> >     StringBuilder with a new String?
>
> > You haven't gained anything here, because Integer.toString() has
> > already had to make a string for that integer before you even get in
> > to the StringBuilder.
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com <mailto:hack...@android.com>
>
> > Note: please don't send private questions to me, as I don't have time
> > to provide private support, and so won't reply to such e-mails.  All
> > such questions should be posted on public forums, where I and others
> > can see and answer them.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-15 Thread kk
Just to make sure, can someone please tell me if I'm misusing
StringBuilder here.
This is what I do:

private StringBuilder m_healthString = new StringBuilder(8);

I update by doing:
m_healthString.replace(0, 8, Integer.toString(myHealth));
Is this expensive/wrong? Is there a better way to update a
StringBuilder with a new String?

I render by doing:

myCanvas.drawText(m_healthString, ...); // this is using the char[]
version, which is good

Obviously I will look into a custom version of Integer.toString, which
will
eliminate quite a lot of the allocations in there.

cheers,
kk.

On Nov 15, 1:17 pm, Kostya Vasilyev  wrote:
> SetBounds has a version that takes four integers - no "new Rect" is
> necessary.
>
> As for Integer.toString - it's easy enough to write your own version
> that outputs the result into a supplied "char[]" buffer, that's only
> allocated once. Canvas.drawText() has a version that takes char[].
>
> But I suspect it's something else. Why are you calling System.gc, if
> you've gone to great lengths to minimize memory allocations? Perhaps
> you're calling it too much?
>
> -- Kostya
>
> 15.11.2010 16:09, kk пишет:
>
>
>
>
>
> > DanH,
>
> > I've had a look at the allocations using DDMS. The only things that
> > are being allocated during the game (that I have control over) are
> > Integer.toString and Drawable.setBounds calls.
>
> > Also, I calling System.gc() periodically and it logs the time taken
> > to do the collection...It doesn't seem to be increasing with time.
>
> > I'll try profiling as suggested by Dianne but this is very weird and
> > is holding up my release :(
>
> > cheers,
> > kk.
>
> > On Nov 15, 1:59 am, DanH  wrote:
> >> My guess is that you have a slow memory leak, and GC is taking more
> >> and more time (and happening more frequently) as the garbage builds
> >> up.  You need some traces and profiling to figure out what's going on.
>
> >> On Nov 14, 12:54 pm, kk  wrote:
>
> >>> Hi all,
> >>> I've written a game and I've noticed that after playing for about
> >>> 20-30 minutes the performance starts degrading.
> >>> By performance degradation I mean my average frames-per-second seem to
> >>> slowly drop.
> >>> I've no idea what could be causing this so any help would be greatly
> >>> appreciated.
> >>> I'm doing all my allocs at the beginning and the only things that
> >>> alloc in game according to DDMS are
> >>> Integer.toString operations (for integer values I need to draw with
> >>> drawtext) and setBounds on some drawables.
> >>> (I've no idea how to stop these from happening, so again, if you know
> >>> a way around this please do tell).
> >>> I'm calling System.gc() periodically, when I know not much is going on
> >>> in-game (e.g. between waves of enemies).
> >>> I'm doing this in order to avoid GC from happening during critical
> >>> gameplay periods.
> >>> If you know the answer to any of the following, please do tell (even a
> >>> guess would do :)):
> >>> + Why is performance degrading with time? What could be causing this?
> >>> + Is there a way to avoid allocs due to Integer.toString and
> >>> Drawable.setBounds calls?
> >>> Thank you in advance,
> >>> kk.
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-15 Thread kk
DanH,

I've had a look at the allocations using DDMS. The only things that
are being allocated during the game (that I have control over) are
Integer.toString and Drawable.setBounds calls.

Also, I calling System.gc() periodically and it logs the time taken
to do the collection...It doesn't seem to be increasing with time.

I'll try profiling as suggested by Dianne but this is very weird and
is holding up my release :(

cheers,
kk.

On Nov 15, 1:59 am, DanH  wrote:
> My guess is that you have a slow memory leak, and GC is taking more
> and more time (and happening more frequently) as the garbage builds
> up.  You need some traces and profiling to figure out what's going on.
>
> On Nov 14, 12:54 pm, kk  wrote:
>
>
>
> > Hi all,
>
> > I've written a game and I've noticed that after playing for about
> > 20-30 minutes the performance starts degrading.
> > By performance degradation I mean my average frames-per-second seem to
> > slowly drop.
> > I've no idea what could be causing this so any help would be greatly
> > appreciated.
>
> > I'm doing all my allocs at the beginning and the only things that
> > alloc in game according to DDMS are
> > Integer.toString operations (for integer values I need to draw with
> > drawtext) and setBounds on some drawables.
> > (I've no idea how to stop these from happening, so again, if you know
> > a way around this please do tell).
>
> > I'm calling System.gc() periodically, when I know not much is going on
> > in-game (e.g. between waves of enemies).
> > I'm doing this in order to avoid GC from happening during critical
> > gameplay periods.
>
> > If you know the answer to any of the following, please do tell (even a
> > guess would do :)):
>
> > + Why is performance degrading with time? What could be causing this?
> > + Is there a way to avoid allocs due to Integer.toString and
> > Drawable.setBounds calls?
>
> > Thank you in advance,
> > kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Game performance degrading over time - any ideas?

2010-11-14 Thread kk
Hey all,

Thank you for your replies. I don't use SQLite or the Preference
editor.
The string lookup is definitely something worth considering.

In terms of profiling, I do:

Debug.startMethodTracing("g1");

in OnCreate and then stop tracing in OnDestroy.
Are you saying that I should create 2 trace files,
say one for the first half and one for the second half
of the game and compare the results?

Sounds like a good plan - I just have no clue as to what
could be causing this degredation :(

cheers,
kk.


On Nov 14, 9:14 pm, Dianne Hackborn  wrote:
> Have you tried running the profiling at the beginning and then later when it
> is noticeable slower, and comparing the two results?
>
>
>
>
>
>
>
>
>
> On Sun, Nov 14, 2010 at 10:54 AM, kk  wrote:
> > Hi all,
>
> > I've written a game and I've noticed that after playing for about
> > 20-30 minutes the performance starts degrading.
> > By performance degradation I mean my average frames-per-second seem to
> > slowly drop.
> > I've no idea what could be causing this so any help would be greatly
> > appreciated.
>
> > I'm doing all my allocs at the beginning and the only things that
> > alloc in game according to DDMS are
> > Integer.toString operations (for integer values I need to draw with
> > drawtext) and setBounds on some drawables.
> > (I've no idea how to stop these from happening, so again, if you know
> > a way around this please do tell).
>
> > I'm calling System.gc() periodically, when I know not much is going on
> > in-game (e.g. between waves of enemies).
> > I'm doing this in order to avoid GC from happening during critical
> > gameplay periods.
>
> > If you know the answer to any of the following, please do tell (even a
> > guess would do :)):
>
> > + Why is performance degrading with time? What could be causing this?
> > + Is there a way to avoid allocs due to Integer.toString and
> > Drawable.setBounds calls?
>
> > Thank you in advance,
> > kk.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Game performance degrading over time - any ideas?

2010-11-14 Thread kk
Hi all,

I've written a game and I've noticed that after playing for about
20-30 minutes the performance starts degrading.
By performance degradation I mean my average frames-per-second seem to
slowly drop.
I've no idea what could be causing this so any help would be greatly
appreciated.

I'm doing all my allocs at the beginning and the only things that
alloc in game according to DDMS are
Integer.toString operations (for integer values I need to draw with
drawtext) and setBounds on some drawables.
(I've no idea how to stop these from happening, so again, if you know
a way around this please do tell).

I'm calling System.gc() periodically, when I know not much is going on
in-game (e.g. between waves of enemies).
I'm doing this in order to avoid GC from happening during critical
gameplay periods.

If you know the answer to any of the following, please do tell (even a
guess would do :)):

+ Why is performance degrading with time? What could be causing this?
+ Is there a way to avoid allocs due to Integer.toString and
Drawable.setBounds calls?

Thank you in advance,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Understanding DDMS allocations - stopping the GC from working overtime!

2010-11-07 Thread kk
Hi all,

I'm writing a game and I'm trying to avoid the GC kicking in and
causing big framerate drops.
I've run DDMS to see what allocations I'm causing and the huge
majority of them seem to fall under 2 categories:

1) class java.lang.String, allocated in java.lang.Integer, allocated
in toString
2) class java.lang.String, allocated in
java.lang.AbstractStringBuilder, allocated in toString

In my game I need to display some stats so there are a few number-to-
string operations.
I went the StringBuilder way with pre-allocated buffers assuming this
will help reduce allocations.

So for example I have a

private StringBuilder m_hitRatio - new StringBuilder(8);

I draw using
canvas.drawText(m_hitRatio.toString(), x, y, paint);

I update using
m_hitRatio.replace(0, 8, String.valueOf(calculatedHitRatio));

In some cases if I'm passing a normal string to a method I also use
Integer.toString(myValue);
I'm guessing all of the above is the reason my GC is working overtime!
Are there better ways (using canvas) to manipulate and render text/
numbers on screen?

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] stopping the GC from kicking in

2010-10-19 Thread kk
Hi all,

When the GC kicks in during my game I sometimes get a noticeable
framerate drop, which is to be expected.

In logcat I get the usual:
   D/dalvikvm(   85): GC freed 55745 objects / 3149712 bytes in 709ms

Is there any way to get more info as to what is causing this?
I.e. what in my code is causing the GC to kick in...

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem opening page with javascript pop ups in webview

2010-09-27 Thread KK
I went through the page source and it looks like the 2 links that are
not supported are opened as IFRAMEs. are IFRAMEs supported by WebView?

On Sep 27, 5:08 pm, KK  wrote:
> I tried that.. onCreateWindow of WebChromeClient does not seem to get
> called.
>
> On Sep 27, 3:59 pm, Mark Murphy  wrote:
>
>
>
> > Try also implementing a WebChromeClient and look at onCreateWindow().
> > It may be that the default implementation of onCreateWindow() (which
> > returns null) means to block the popup.
>
> > On Mon, Sep 27, 2010 at 6:07 AM, KK  
> > wrote:
> > > I am very new to both android webkit and javascript. I have a web page
> > > with 3 links (say A,B,C). When I open that page on my PC
> > > browser(Chrome), and click on the links, A opens in the same browser
> > > window whereas B and C pops up a new window. In my application I am
> > > loading the original URL in a WebView. I have implemented my
> > > WebViewClient and overridden the shouldOverrideUrlLoading. I am
> > > getting the call to shouldOverrideUrlLoading whenever I click on A,
> > > but not getting it when I click on B or C? Can someone help me as to
> > > why this is happeneing?
>
> > > Thanks
> > > KK
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android Training in London:http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem opening page with javascript pop ups in webview

2010-09-27 Thread KK
I tried that.. onCreateWindow of WebChromeClient does not seem to get
called.

On Sep 27, 3:59 pm, Mark Murphy  wrote:
> Try also implementing a WebChromeClient and look at onCreateWindow().
> It may be that the default implementation of onCreateWindow() (which
> returns null) means to block the popup.
>
>
>
>
>
> On Mon, Sep 27, 2010 at 6:07 AM, KK  
> wrote:
> > I am very new to both android webkit and javascript. I have a web page
> > with 3 links (say A,B,C). When I open that page on my PC
> > browser(Chrome), and click on the links, A opens in the same browser
> > window whereas B and C pops up a new window. In my application I am
> > loading the original URL in a WebView. I have implemented my
> > WebViewClient and overridden the shouldOverrideUrlLoading. I am
> > getting the call to shouldOverrideUrlLoading whenever I click on A,
> > but not getting it when I click on B or C? Can someone help me as to
> > why this is happeneing?
>
> > Thanks
> > KK
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android Training in London:http://skillsmatter.com/go/os-mobile-server

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Problem opening page with javascript pop ups in webview

2010-09-27 Thread KK
I am very new to both android webkit and javascript. I have a web page
with 3 links (say A,B,C). When I open that page on my PC
browser(Chrome), and click on the links, A opens in the same browser
window whereas B and C pops up a new window. In my application I am
loading the original URL in a WebView. I have implemented my
WebViewClient and overridden the shouldOverrideUrlLoading. I am
getting the call to shouldOverrideUrlLoading whenever I click on A,
but not getting it when I click on B or C? Can someone help me as to
why this is happeneing?

Thanks
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: MediaPlayer showstopper bug - please help

2010-09-23 Thread kk
Thanks for the feedback Jason. Switching to OGG definitely fixed my
issue.
The other thing I noticed is that the setLooping call to MediaPlayer
has no effect at all.
If you want looping you just set the metadata tag ANDROID_LOOP=true.

For SFX I'm using SoundPool, which seems to be doing the trick.
Thanks again for the response.

cheers,
kk.

On 23 Sep, 16:44, Jason  wrote:
> Wow.. that IS weird.
>
> I'm not sure what the problem is here, but there are a couple of
> things I do differently:
>
> 1. Don't use MP3.  Apparently the MP3 decoder on Android is a bit
> crufty.  I was advised to use the OGG format and it works well.  You
> can create OGG files using Audacity (it's 
> free)http://audacity.sourceforge.net/
> 2. I create MediaPlayer instances using a simpler method, specifically
> the following:
>
> A) ALL of my sound files are in resources/raw (not assets)
> B) When I want to load a sound for the game it has it's own
> MediaPlayer instance (same as you)
> C) I create MediaPlayer instances using the following:
>
> MediaPlayer.create(context, resourceId);
>
> where resourceId is something like:
>
> R.raw.bgmusic
>
> This does all the data source creation etc for me, and once the call
> is complete the sound is ready to play
>
> I wonder if the way you are creating the datasource is somehow
> creating a reference to the entire folder?
>
> Also, I don't think you need to create the stream (assuming you don't
> want to use the MediaPlayer.create() method I use).  According to the
> doco the AssetFileDescriptor returned from openFd has a method called
> getFileDescriptor()
>
> On 23 Sep, 07:22, kk  wrote:
>
>
>
> > Hi all,
>
> > I'm having some trouble streaming a looping background track for my
> > game using MediaPlayer.
>
> > I have a bunch of short mp3s in /res/raw that I use as SFX and I play
> > using SoundPool.
> > The SFX playback all works fine...I'm mentioning it because it's
> > relevant as you'll see below.
>
> > The background music track (also an mp3) lives in /assets. The code I
> > use to play this track is at the bottom
> > of this post. Here's what happens:
>
> > Instead of the track looping, once it has finished playing, it starts
> > playing all the SFX from /res/raw in sequence!
> > Then, once all these have finished playing it starts all over again,
> > i.e. playing the background music track
> > and then all the SFX in the same order.
>
> > As if that wasn't weird enough, the behaviour described above only
> > happens in the emulator.
> > When tested on an HTC Tattoo and an HTC Desire it only does the above
> > once. I.e. it plays the background music
> > track, then all the SFX, and then it stops...it doesn't loop.
>
> > Any help greatly appreciated since nobody here has any idea what's
> > going wrong or how to fix it!
>
> > This is developed using:
> > SDK 1.6 API4 revision 3
> > SDK Tools revision 6
>
> > The code I use for the media player playback:
>
> > =
> > // note: p_theSurfaceView below is my class that extends SurfaceView
> > implements SurfaceHolder.Callback
> > MediaPlayer m_mediaPlayer = new MediaPlayer();
> > FileInputStream l_fis;
> > try
> > {
> >     l_fis =
> > p_theSurfaceView.getContext().getAssets().openFd("bgmusic.mp3").createInput 
> > Stream();
> >     m_mediaPlayer.setDataSource(l_fis.getFD());
> >     // from the docs: It is the caller's responsibility to close the
> > file descriptor.
> >     // from the docs: It is safe to do so as soon as the setDataSource
> > call returns.
> >     l_fis.close();
>
> >     m_mediaPlayer.prepare();
>
> >     m_mediaPlayer.setLooping(true);
> >     m_mediaPlayer.setOnErrorListener(
> >             new MediaPlayer.OnErrorListener() {
> >                 public boolean onError(MediaPlayer p_mp, int p_what,
> > int p_extra)
> >                 {
> >                     Log.e("m_mediaPlayer", "ERROR: MediaPlayer: (" +
> > p_what +") with extra (" + p_extra +")" );
> >                     return false;
> >                 }
> >             });
>
> >     m_mediaPlayer.start();}
>
> > catch (IllegalArgumentException e)
> > {
> >     e.printStackTrace();
> >     m_mediaPlayer = null;
> >     return false;}
>
> > catch (IllegalStateException e)
> > {
> >     e.printStackTrace();
> >     m_mediaPlayer = null;
> >     return false;}
>
> > catch (IOException e)
> > {
> >     e.printStackTrace();
> >     m_mediaPlayer = null;
> >     return false;
>
> > }
>
> > return true;
> > =
>
> > cheers,
> > kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] MediaPlayer showstopper bug - please help

2010-09-22 Thread kk
Hi all,

I'm having some trouble streaming a looping background track for my
game using MediaPlayer.

I have a bunch of short mp3s in /res/raw that I use as SFX and I play
using SoundPool.
The SFX playback all works fine...I'm mentioning it because it's
relevant as you'll see below.

The background music track (also an mp3) lives in /assets. The code I
use to play this track is at the bottom
of this post. Here's what happens:

Instead of the track looping, once it has finished playing, it starts
playing all the SFX from /res/raw in sequence!
Then, once all these have finished playing it starts all over again,
i.e. playing the background music track
and then all the SFX in the same order.

As if that wasn't weird enough, the behaviour described above only
happens in the emulator.
When tested on an HTC Tattoo and an HTC Desire it only does the above
once. I.e. it plays the background music
track, then all the SFX, and then it stops...it doesn't loop.

Any help greatly appreciated since nobody here has any idea what's
going wrong or how to fix it!

This is developed using:
SDK 1.6 API4 revision 3
SDK Tools revision 6

The code I use for the media player playback:

=
// note: p_theSurfaceView below is my class that extends SurfaceView
implements SurfaceHolder.Callback
MediaPlayer m_mediaPlayer = new MediaPlayer();
FileInputStream l_fis;
try
{
l_fis =
p_theSurfaceView.getContext().getAssets().openFd("bgmusic.mp3").createInputStream();
m_mediaPlayer.setDataSource(l_fis.getFD());
// from the docs: It is the caller's responsibility to close the
file descriptor.
// from the docs: It is safe to do so as soon as the setDataSource
call returns.
l_fis.close();

m_mediaPlayer.prepare();

m_mediaPlayer.setLooping(true);
m_mediaPlayer.setOnErrorListener(
new MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer p_mp, int p_what,
int p_extra)
{
Log.e("m_mediaPlayer", "ERROR: MediaPlayer: (" +
p_what +") with extra (" + p_extra +")" );
return false;
}
});

m_mediaPlayer.start();
}
catch (IllegalArgumentException e)
{
e.printStackTrace();
m_mediaPlayer = null;
return false;
}
catch (IllegalStateException e)
{
e.printStackTrace();
m_mediaPlayer = null;
return false;
}
catch (IOException e)
{
e.printStackTrace();
m_mediaPlayer = null;
return false;
}

return true;
=

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] media player not looping properly

2010-08-09 Thread kk
Hi all,

I'm trying to play a looping background track in my app and it doesn't
loop.
The track starts playing and once it reaches the end all I hear is a
weird crackly sound for a split second and then nothing else.
Logcat doesn't show anything useful at the time. No errors/warning/
exceptions/etc.

Here's how I'm doing it...
During initialisation I call this:

public static MediaPlayer MEDIA_PLAYER;

private static boolean initMusicPlayer(InGameView p_inGameView)
{
MEDIA_PLAYER = MediaPlayer.create(p_inGameView.getContext(),
R.raw.bgmusic);
MEDIA_PLAYER.setOnErrorListener(
new MediaPlayer.OnErrorListener() {
public boolean onError(MediaPlayer p_mp, int 
p_what, int
p_extra)
{
Log.e("MEDIA_PLAYER", "ERROR: 
MediaPlayer: (" + p_what +")
with extra (" + p_extra +")" );
return false;
}
});

MEDIA_PLAYER.setLooping(true);

return true;
}

Then, in the surfaceChanged of my InGameView (i.e. when things are
good to go), I call

  MEDIA_PLAYER.start();

Can you guys see anything wrong with the above? Any ideas what could
be causing this?
All help greatly appreciated.

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: adding audio to a game - triggerClip for SFX

2010-07-30 Thread kk
Dave,

Thank you for your quick response. SoundPool is indeed the right way
to go
and I've got my SFX playing...pretty straight forward interface.

A small problem I'm having is that during playback I get a lot of:

W/AudioFlinger(   31): write blocked for 50 msecs

Also, although my (relative short) SFX are playing, the background
music fails with:

E/AudioCache(   31): Heap size overflow! req size: 1050624, max size:
1048576

This same audio track worked fine with JetPlayer. Any idea why
SoundPool thinks it's too big?

cheers,
k.

On 30 July, 17:27, Dave Sparks  wrote:
> triggerClip() was designed to play synchronized sound effects for
> musical games like JetBoy.
>
> If you just want to play random sound effects, I would use SoundPool
> instead.
>
> On Jul 30, 5:53 am, kk  wrote:
>
>
>
> > Hi all,
>
> > I'm using JetPlayer in order to add some audio to a game I'm
> > developing.
> > Using the examples in JetBoy I have managed to create a .jet file
> > using JetCreator and play an audio track.
> > So far so good. However, I'm having some trouble playing sound effects
> > for my game.
>
> > I have a set of very small .mid files, each containing a shooting
> > sound for a different weapon.
> > However, when I try to add the .mid file in JetCreator I get
> >    "The segment starting and ending times are illogical"
> > I'm guessing this is because the clip is too short and starting/ending
> > M/B/T are both 1/1/0 ?
>
> > The idea was to add these SFXs and then use triggerClip to play them.
> > My question is, background music aside (I can make that work) what's
> > the best way to add SFX in a game
> > so that you can trigger them at any point programmaticaly? (i.e. have
> > something like playShootingSFX1(),
> > playShootingSFX2(), etc. that will go and play the SFX immediately).
>
> > thx in advance,
> > k.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] adding audio to a game - triggerClip for SFX

2010-07-30 Thread kk
Hi all,

I'm using JetPlayer in order to add some audio to a game I'm
developing.
Using the examples in JetBoy I have managed to create a .jet file
using JetCreator and play an audio track.
So far so good. However, I'm having some trouble playing sound effects
for my game.

I have a set of very small .mid files, each containing a shooting
sound for a different weapon.
However, when I try to add the .mid file in JetCreator I get
   "The segment starting and ending times are illogical"
I'm guessing this is because the clip is too short and starting/ending
M/B/T are both 1/1/0 ?

The idea was to add these SFXs and then use triggerClip to play them.
My question is, background music aside (I can make that work) what's
the best way to add SFX in a game
so that you can trigger them at any point programmaticaly? (i.e. have
something like playShootingSFX1(),
playShootingSFX2(), etc. that will go and play the SFX immediately).

thx in advance,
k.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: GLSurfaceView onPause blocked in Froyo

2010-05-27 Thread KK
I am calling it because the documentation tells so.

public void onPause ()

Since: API Level 3
Inform the view that the activity is paused. The owner of this view
must call this method when the activity is paused. Calling this method
will pause the rendering thread. Must not be called before a renderer
has been set.


If i don't call this the OpenGL rendering thread will keep on giving
the onDrawFrame calls.

regards
KK

On May 26, 11:06 pm, Indicator Veritatis  wrote:
> The first thing that pops out as odd, possibly related to your
> problem, is that as you describe it, you are callingonPause() and
> onResume() yourself. These are meant to be called by the system, not
> the API user (you). Are you really calling these yourself? If so, why?
>
> On May 26, 6:25 am, KK  wrote:
>
>
>
> > I am using OpenGL to do some rendering and whenever my rendering gets
> > paused I callonPauseofGLSurfaceViewand later when I resume
> > onResume ofGLSurfaceView. This was working fine till I upgraded my
> > Nexus One to Froyo today. After that the thread callingonPauseseems
> > to be blocked in that API. Anyone has any idea why this is happening?
> > Is there anything I need to change for this to work on Froyo?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] GLSurfaceView onPause blocked in Froyo

2010-05-26 Thread KK
I am using OpenGL to do some rendering and whenever my rendering gets
paused I call onPause of GLSurfaceView and later when I resume
onResume of GLSurfaceView. This was working fine till I upgraded my
Nexus One to Froyo today. After that the thread calling onPause seems
to be blocked in that API. Anyone has any idea why this is happening?
Is there anything I need to change for this to work on Froyo?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Emulator Proxy Settings via APN not working

2010-05-20 Thread kk
Hi All,

Can't get Froyo (Android SDK 2.2 release) APN emulator proxy settings
working.

Via eclair proxy settings work enable via APN configuration (adding
proxy server and proxy server port).

Now in FroYo release this manner of configuration is not working, any
workarounds?


Rgds,

KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to set and get thread priority from Java and native layers

2010-05-14 Thread KK
Ok, finally I seem to have found out some more of what is happening. I
am able to set any priority > 0. But if I try priorities <= 0 it
throws an exception. For all my practical purposes, positive
priorities are enough. But anyone has any idea what application is not
allowed to use any priorities <= 0?

Thanks
KK

On May 11, 9:16 pm, Streets Of Boston  wrote:
> It could be that thethread'sThreadGroup has a maximumpriorityof 5.
> Athread'sprioritycannot be higher than it'sthread-group max-priority.
>
> It could be that some code you didn't code, but call instead, that
> sets thethreadpriorityto 5.
>
> On May 10, 11:37 pm, Krishnakumar Ramachandran
>
>
>
>
>
>  wrote:
> > I tried that too. But still when I try to query my audiothread'spriority,
> > it still shows itspriorityas 5.
>
> > On Tue, May 11, 2010 at 8:25 AM, Streets Of Boston
> > wrote:
>
> > > What aboutThread.setPriority(...) ?
>
> > > That seems to be working for me.
> > > When, using the above method, isetthepriorityof a background-
> > >threadtoo high it has an impact on the GUI (it gets sluggish). It
> > > must be doing something...
>
> > > On May 10, 9:20 pm, Krishnakumar Ramachandran
> > >  wrote:
> > > > Hi has anyone got any idea on this?
>
> > > > On Mon, May 10, 2010 at 12:56 PM, KK <
> > > krishnakumar.ramachand...@gmail.com>wrote:
>
> > > > > I have a multithreaded streaming app which has mainly the following 5
> > > > > threads
>
> > > > > 1 Main App(UI)Thread
> > > > > 1 controllerthread(in native)
> > > > > 1 audio decoderthread(in native)
> > > > > 1 video decoderthread(in native)
> > > > > 1threadto query the head position of audio (inJava)
> > > > >  Apart from this I have video rendering with OpenGL.
>
> > > > > My problem is, if I query thethreadpriorityusing the
> > > > >Thread.getPriority method (my native threads make callbacks toJava
> > > > > and I am making the query at that point of time), I am getting the
> > > > >priorityof each of them as 5. For my audio querythread(the last one
> > > > > in the list) I am explicitly setting thepriorityusing
> > > > > Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);
>
> > > > > Also for my decoder threads, I am giving higherprioritythan my
> > > > > controllerthread(using pthread APIs in native). But still finally all
> > > > > of them seem to have samepriority.
>
> > > > > Can anyone please tell me what is wrong here. Also what should I be
> > > > > doing to increase thepriorityof my threads(both fromJavaand
> > > > > native).
>
> > > > > Thanks
> > > > > KK
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > > > Groups "Android Developers" group.
> > > > > To post to this group, send email to
> > > android-developers@googlegroups.com
> > > > > To unsubscribe from this group, send email to
> > > > > android-developers+unsubscr...@googlegroups.com > > > >  ­cr...@googlegroups.com>
> > > 
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/android-developers?hl=en
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "Android Developers" group.
> > > > To post to this group, send email to android-developers@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > android-developers+unsubscr...@googlegroups.com > > >  ­cr...@googlegroups.com>
> > > > For more options, visit this group athttp://
> > > groups.google.com/group/android-developers?hl=en- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com > >  ­cr...@googlegroups.com>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > You recei

[android-developers] How to set and get thread priority from Java and native layers

2010-05-10 Thread KK
I have a multithreaded streaming app which has mainly the following 5
threads

1 Main App(UI) Thread
1 controller thread (in native)
1 audio decoder thread (in native)
1 video decoder thread(in native)
1 thread to query the head position of audio (in Java)
 Apart from this I have video rendering with OpenGL.

My problem is, if I query the thread priority using the
Thread.getPriority method (my native threads make callbacks to Java
and I am making the query at that point of time), I am getting the
priority of each of them as 5. For my audio query thread (the last one
in the list) I am explicitly setting the priority using
Process.setThreadPriority(Process.THREAD_PRIORITY_URGENT_AUDIO);

Also for my decoder threads, I am giving higher priority than my
controller thread(using pthread APIs in native). But still finally all
of them seem to have same priority.

Can anyone please tell me what is wrong here. Also what should I be
doing to increase the priority of my threads(both from Java and
native).

Thanks
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Wifi drop Issues on Motorola Droid

2010-05-06 Thread KK
I am trying to develop a streaming application and I am testing it on
multiple devices. But I am seeing some problems on Motorola Droid with
regards to wifi connection. The wifi connection drops occasionally and
comes back in 30 seconds to 1 minute on the Droid. Sometimes while in
the middle of streaming I get network connection errors even though I
am standing very next to the wifi router. I am not finding this
problem with any other devices. Has anyone found any similar issues
with the Droid? Any idea what can be done in my program to fix this?

Thanks
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Getting the amount of Audio data buffered in the device

2010-04-05 Thread KK
I am trying to write a streaming application. I have my own decoder
and I am playing PCM audio using AudioTrack. At any point in time I
want to know how much data is buffered with the device. I want to use
this so that if the data with the device go below a level, I want to
go into a buffering mode where I will buffer 2-3 seconds of data
before continuing playback again. Can someone please tell me how to do
this?

Thanks in advance
KK

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.


[android-developers] JetPlayer keeps logging "write blocked for X msecs" - is this normal?

2010-02-18 Thread kk
Hello all,

I'm trying to add audio to my game and following the jetboy tutorial
and dev pages I'm doing it as follows:

I'm initialising like this:

JetPlayer JET_PLAYER = JetPlayer.getJetPlayer();
JET_PLAYER.clearQueue();
JET_PLAYER.loadJetFile(p_resources.openRawResourceFd(R.raw.ingame1));
byte sSegmentID = 0;
JET_PLAYER.queueJetSegment(0, -1, 0, 0, 0, sSegmentID);

then doing:

JET_PLAYER.play();

ingame1.jet only contains 1 segment, which is the track I'm trying to
play.
The audio plays ok but I keep getting these in logcat:

W/AudioFlinger(   31): write blocked for 49 msecs
W/AudioFlinger(   31): write blocked for 50 msecs
W/AudioFlinger(   31): write blocked for 54 msecs

They are quite frequent...3-4 of those per second. Is this normal or
am I doing something wrong?

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] can an updated version of an app try to restore using a bundle containing older data?

2010-02-17 Thread kk
Hello all,

I'm trying to prevent the situation where an updated version of my app
restores using a bundle written from a previous version of my app. In
other words:

1) app v1 stops and calls onSaveInstanceState
2) app v1 saves the bundle (call it v1 data)
3) user goes to marketplace and updates the app to v2
4) user starts the v2 version of the app
5) v2 version calls onCreate passing the bundle with v1 data (i.e. the
one saved during step (2))

Is that even possible? Do I need to worry about it?

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] triggering onCreate with a non-null Bundle (or onRestoreInstanceState) from the emulator

2010-02-16 Thread kk
Hi all,

I've recently done quite a bit of work on saving instance state and
restoring using parcelables for custom data structures.
My problem is that I don't know how to test this functionality on the
emulator. I can trigger calls to onPause and onStop for my activity
(if I navigate out of it) but never onDestroy. So, whenever my app
starts up, it starts with a null bundle. I've never had onCreate with
a non-null bundle and I've never had onRestoreInstanceState getting
called.

Can someone please tell me how I can test the restore state
functionality from the emulator?

cheers,
kk.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Problem with fwrite onto sdcard

2009-12-04 Thread KK
Hi,

  I am very new to Android. I am trying the following code in the
android ndk.

FILE* fp = fopen("/sdcard/test", "wb")
if(NULL == fp)
{
  return errno;
}
int written = fwrite("Test", 1, 4, fp);
if(4 != written)
{
  return -1;
}
fclose(fp);

return 0;

I am trying this on emulator and I have created and sdcard for the
emulator. The function returns 0. When I check the sdcard, a file with
the name is created, but it is empty. Can anyone please help me on
this?

Thanks in advance

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Emulator: 1.6 SDK release Troubleshooting Proxy

2009-09-15 Thread kk

Hi All,

Trying to troubleshoot proxy, but  command as indicated in SDK
Emulator documentation results in invalid command prompt:

Documented Command:
emulator -verbose-proxy -avd

Error indicated:

  unknown option: -verbose-proxy
  please use -help for a list of valid options

In previous SDK releases (1.5)  the following undocumented command was
functional, but now does not post any messages when accessing
Network via Browser.

emulator -debug-proxy -avd mydevice


What is the appropriate command to troubleshoot proxy?

Is this a known issue and/or bug?


Rgds,

KK
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Emulator: LogCat Errors for Donut 1.6 Release

2009-09-15 Thread kk

Hi All,

The following errors occurred during startup of Android 1.6 SDK
Release Emulator:


What do the following errors mean?

Can these errors be ignored?


Emulator Details:


Target: Google APIs (API Level 4)
Skin: HVGA
SDCARD: 64MB  image size


Errors:

09-16 13:16:00.072: ERROR/vold(550): Error opening switch name path '/
sys/class/switch/test2' (No such file or directory)
09-16 13:16:00.072: ERROR/vold(550): Error bootstrapping switch '/sys/
class/switch/test2' (No such file or directory)
09-16 13:16:00.072: ERROR/vold(550): Error opening switch name path '/
sys/class/switch/test' (No such file or directory)
09-16 13:16:00.072: ERROR/vold(550): Error bootstrapping switch '/sys/
class/switch/test' (No such file or directory)
09-16 13:16:54.123: ERROR/MemoryHeapBase(582): error opening /dev/
pmem: No such file or directory
09-16 13:16:54.133: ERROR/SurfaceFlinger(582): Couldn't open /sys/
power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
09-16 13:16:54.312: ERROR/libEGL(582): couldn't load 
library (Cannot load library: load_library[984]: Library 'libhgl.so'
not found)
09-16 13:16:56.602: ERROR/libEGL(598): couldn't load 
library (Cannot load library: load_library[984]: Library 'libhgl.so'
not found)
09-16 13:17:17.392: ERROR/BatteryService(582): Could not open '/sys/
class/power_supply/usb/online'
09-16 13:17:17.392: ERROR/BatteryService(582): Could not open '/sys/
class/power_supply/battery/batt_vol'
09-16 13:17:17.401: ERROR/BatteryService(582): Could not open '/sys/
class/power_supply/battery/batt_temp'
09-16 13:17:19.242: ERROR/EventHub(582): could not get driver version
for /dev/input/mouse0, Not a typewriter
09-16 13:17:19.271: ERROR/EventHub(582): could not get driver version
for /dev/input/mice, Not a typewriter
09-16 13:17:19.852: ERROR/System(582): Failure starting core service
09-16 13:17:19.852: ERROR/System(582): java.lang.SecurityException
09-16 13:17:19.852: ERROR/System(582): at
android.os.BinderProxy.transact(Native Method)
09-16 13:17:19.852: ERROR/System(582): at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
09-16 13:17:19.852: ERROR/System(582): at
android.os.ServiceManager.addService(ServiceManager.java:72)
09-16 13:17:19.852: ERROR/System(582): at
com.android.server.ServerThread.run(SystemServer.java:162)
09-16 13:17:19.892: ERROR/AndroidRuntime(582): Crash logging skipped,
no checkin service
09-16 13:17:26.013: ERROR/LockPatternKeyguardView(582): Failed to bind
to GLS while checking for account



Thanks,
KK

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Supported Media Formats Programmatically

2009-09-09 Thread kk

Hi Ajeet,

Thanks for the reply.

This is great information, but unfortunately does not address my
question.

I am not certain that querying the Webkit interface gurantees that the
mimetype is support on across the platform, let alone via Webkit based
applications.

Documentation to sparse to determine.

Regards,

KK


On Sep 9, 5:37 pm, Ajeet Singh  wrote:
> See the class MimeTypeMap.java (frameworks\base\core\java\android
> \webkit)
>
> Hope this helps you.
>
> AJ
>
>
>
> kk wrote:
> > How do I determine programmatically which Media MimeTypes/Formats are
> > supported on a specific device/platform?
>
> > There doesn't appear to be any methods in Media Store or Media
> > Managers to determine supported types on device.
>
> > Is this by design or can we expect to see support in future releases?
>
> > Regards,
>
> > KK
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Supported Media Formats Programmatically

2009-09-08 Thread kk

How do I determine programmatically which Media MimeTypes/Formats are
supported on a specific device/platform?

There doesn't appear to be any methods in Media Store or Media
Managers to determine supported types on device.

Is this by design or can we expect to see support in future releases?


Regards,

KK


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] BroadcastReceiver and Google Services Inquiry

2009-06-19 Thread kk

Hi All,

I have been working on BroadcastReceiver code to capture GMAIL events
and try to extract data to create an email event log.

Although the registration of the BroadcastReceiver using
Intent.PROVIDER_CHANGED for gmail appears to be correctly formed and
no exceptions are generated.  I have my doubts whether the receiver is
able to capture gmail event for Intent.PROVIDER_CHANGED, generated
when unread email is available, since code in my BroadcastReceiver is
never activated.   Upon reading the BroadcastReciever API docs (see
excerpt below) I see that BroadcastReceivers are not designed to
capture intents used with startActivity() and that BroadcastReceivers
only receive intents generated from a sendBroadcast() method call.
For your reference see my code snippets below.

Is the BroadcastReceiver mechanism not the appropriate method to
capture email/gmail/sms events?



BroadcastReceiver code is the following:

public class EmailReceiver extends BroadcastReceiver {
/**
 *
 */

String TAG= "MY_TAG:RECEIVER";

@Override
public void onReceive(Context context, Intent intent) {
//
Log.i(TAG, "Action=" + intent.getAction());
  if (Intent.ACTION_PROVIDER_CHANGED.equals(intent.getAction
())) {
  Uri dataURI= intent.getData();
  String dataURIPath=dataURI.getPath();
  Log.i(TAG, dataURIPath);
   }
}
}


BroadcastReceiver code registration for gmail is the following:
//

@override
public void onCreate(Bundle b){


EmailReceiver myMailReceiver = new EmailReceiver();

..

}


@Override
public void onResume(){
super.onResume();

 try{
   IntentFilter mailFilter = new IntentFilter
( Intent.ACTION_PROVIDER_CHANGED, "content://gmail-ls/unread/^i");
   // IntentFilter mailFilter = new IntentFilter
( Intent.ACTION_PROVIDER_CHANGED, "gmail-ls");
registerReceiver( myMailReceiver, mailFilter);
Log.i(myMailReceiver.TAG, "MailReceiver registered");
  }catch(Exception e){
Log.e(myMailReceiver.TAG, "Intent Filter malformed");
  }

}

Excerpt from BroadcastReceiver Doc:

Base class for code that will receive intents sent by sendBroadcast
().



Note that, although the Intent class is used for sending and receiving
these broadcasts, the Intent broadcast mechanism here is completely
separate from Intents that are used to start Activities with
Context.startActivity(). There is no way for a BroadcastReceiver to
see or capture Intents used with startActivity(); likewise, when you
broadcast an Intent, you will never find or start an Activity. These
two operations are semantically very different: starting an Activity
with an Intent is a foreground operation that modifies what the user
is currently interacting with; broadcasting an Intent is a background
operation that the user is not normally aware of.

.

Regards,

KK
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google Login Service not working on SDK 1.5

2009-05-15 Thread kk

Hi Farida,

I am experiencing the same issue.

Has anybody responded to your inquiry?

Regards,

KK

On Apr 29, 12:48 am, farida  wrote:
> I downloaded the latest release of android SDK 1.5, but unable to give
> the credentials for the "Google Login Service" from devTools. Clicking
> on the Google button or any other button crashes. I need to specify
> the google credentials to access the calendar application so that I
> can customize it as per the requirements. Can you please let me know
> if there is any other work around of doing this and accessing the
> calendar application?
>
> Thanks
> Farida

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google Login Service not working on SDK 1.5

2009-05-15 Thread kk

Hi All,

I experience the same behavior Farida is reporting. It appears the
GoogleLoginService is not found on emulator.

Here is my emulator info:

 Target: Google APIs (Google Inc.)
 Based on Android 1.5 (API level 3)
   Skin: HVGA
 Sdcard: 100M

Here is my logCat output:

05-16 01:04:02.467: WARN/ActivityManager(579): Unable to start service
Intent { comp={com.goo
gle.android.googleapps/
com.google.android.googleapps.GoogleLoginService} }: not found
05-16 01:04:03.017: VERBOSE/GLSTester(795): hello, world!
05-16 01:04:04.426: INFO/ActivityManager(579): Displayed activity
com.android.development/.GL
STester: 2257 ms
05-16 01:04:10.356: DEBUG/dalvikvm(621): GC freed 302 objects / 13592
bytes in 450ms
05-16 01:04:12.416: WARN/KeyCharacterMap(795): No keyboard for id 0
05-16 01:04:12.459: WARN/KeyCharacterMap(795): Using default keymap: /
system/usr/keychars/qwe
rty.kcm.bin
05-16 01:04:37.006: DEBUG/dalvikvm(795): GC freed 1384 objects / 91288
bytes in 1136ms
05-16 01:04:37.487: WARN/KeyCharacterMap(795): No keyboard for id 0
05-16 01:04:37.679: WARN/KeyCharacterMap(795): Using default keymap: /
system/usr/keychars/qwe
rty.kcm.bin
05-16 01:04:54.737: DEBUG/dalvikvm(579): GC freed 15406 objects /
738856 bytes in 1187ms
05-16 01:04:54.858: WARN/InputManagerService(579): Window already
focused, ignoring focus gai
n of: com.android.internal.view.iinputmethodclient$stub$pr...@437a9c38
05-16 01:05:00.976: DEBUG/AndroidRuntime(795): Shutting down VM
05-16 01:05:01.027: WARN/dalvikvm(795): threadid=3: thread exiting
with uncaught exception (g
roup=0x4000fe70)
05-16 01:05:01.037: ERROR/AndroidRuntime(795): Uncaught handler:
thread main exiting due to u
ncaught exception
05-16 01:05:01.166: ERROR/AndroidRuntime(795):
java.lang.NullPointerException
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
com.android.development.GLSTester$4.onC
lick(GLSTester.java:166)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.View.performClick(View.jav
a:2179)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.View.onTouchEvent(View.jav
a:3828)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.widget.TextView.onTouchEvent(Te
xtView.java:6291)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.View.dispatchTouchEvent(Vi
ew.java:3368)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.ViewGroup.dispatchTouchEve
nt(ViewGroup.java:863)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.ViewGroup.dispatchTouchEve
nt(ViewGroup.java:863)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.ViewGroup.dispatchTouchEve
nt(ViewGroup.java:863)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.ViewGroup.dispatchTouchEve
nt(ViewGroup.java:863)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.ViewGroup.dispatchTouchEve
nt(ViewGroup.java:863)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
com.android.internal.policy.impl.PhoneW
indow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1707)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
com.android.internal.policy.impl.PhoneW
indow.superDispatchTouchEvent(PhoneWindow.java:1197)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.app.Activity.dispatchTouchEvent
(Activity.java:1993)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
com.android.internal.policy.impl.PhoneW
indow$DecorView.dispatchTouchEvent(PhoneWindow.java:1691)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.view.ViewRoot.handleMessage(Vie
wRoot.java:1525)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.os.Handler.dispatchMessage(Hand
ler.java:99)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.os.Looper.loop(Looper.java:123)

05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
android.app.ActivityThread.main(Activit
yThread.java:3948)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
java.lang.reflect.Method.invokeNative(N
ative Method)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
java.lang.reflect.Method.invoke(Method.
java:521)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
com.android.internal.os.ZygoteInit$Meth
odAndArgsCaller.run(ZygoteInit.java:782)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:540)
05-16 01:05:01.166: ERROR/AndroidRuntime(795): at
dalvik.system.NativeStart.main(Native M
ethod)
05-16 01:05:01.306: INFO/Process(579): Sending signal. PID: 795 SIG: 3
05-16 01:05:01.318: INFO/dalvikvm(795): threadid=7: reacting to signal
3
05-16 01:05:01.386: ERROR/ActivityThread(579): Failed to find provider
info for android.serve
r.checkin
05-16 01:05:01.436: ERROR/Checkin(579): Error reporting crash:
java.lang.IllegalArgumentExcep
tion: Unknown URL content://android.server.checkin/crashes
05-16 01:05:01.667: INFO/dalvikvm(795): Wrote stack trace to '/data/
anr/traces.txt'

On Apr 29, 12:48 am, farida  wrote:
> I downloa

  1   2   >