[android-developers] Platform Versions

2010-09-09 Thread Achanta
I have been waiting for the Platform Versions to be updated since a
few days. They have updated it the last couple of months but not in
September. Can someone at Google look into this.
http://developer.android.com/resources/dashboard/platform-versions.html

thank you.

-- 
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: String being truncated when its long

2010-08-27 Thread Achanta
First of all thanks everyone for replying.

I just discovered that the problem is not with my code but with the
number of lines that the logcat is displaying.
The problem was that I got a problem in my json reply format and my
parsing code spits an error. So I started trying to debug it by
printing the response json string in logcat. This is being truncated
always and I was guessing till now that the reply itself is being
truncated.

So today I started plying with the response string builder and has to
write funny snippets to count characters and detect the characters at
positions I was expecting and I found that the response was being
returned completely.
I also tested my code on some other large stings and I discovered that
the logcat has a limit on the length of the string that it displays or
atleast it looked so. That was why my responses were being displayed
as truncated strings and I thought that its the problem with my code.

So it is working fine as the code is earlier and the only problem was
that the logcat doesnot display the complete string. But it does not
cother me anymore for this problem.

Thanks again everyone for trying to help.



On Aug 27, 1:21 pm, ko5tik kpriblo...@yahoo.com wrote:
 My game has no problem to pull and parse complete highscore list:

 http://www.pribluda.de/highscore/lines/LinesHighscore/pull?since=0

 (ok,  usually it is less that that - only updates sine some moment )

 I would check with some other tool ( SoapUI us the one )  if server
 side works
 properly and delivers everything zoy are waiting for

 regards,

 On Aug 27, 8:51 pm, Brion Emde brione2...@gmail.com wrote:

  I'm pretty sure that if there is a limit, it is much bigger than what
  people are saying here.

  I wrote a little Twitter example on Android and just doing the
  home_timeline query can return up to 200 tweets, each up to 140
  characters, plus overhead. That's 10s of kilobytes per GET request.

  See if looking at this code 
  helps:http://github.com/brione/Brion-Learns-OAuth/blob/master/src/com/examp...

  On Aug 27, 12:44 pm, DanH danhi...@ieee.org wrote:

   My knowledge of the HTTP protocol is poor to begin with, and my bad
   memory doesn't improve it, but I vaguely recall that a single HTTP
   transfer is limited to 5000-odd characters (the precise number being
   somewhat variable) by the packet sizes used in the network.  But
   normally the software used on each end should hide this sensitivity so
   that you can deal in complete data streams up to some significantly
   larger limit.

   It could be that something in your config is causing this transfer
   size to be exposed.  It's also possible that your coding style is
   opening you up to being sensitive to data stream values.  In
   particular, null may be being returned from readLine at the end of the
   block, even though there is more data in the transmission.  (I don't
   know that such is possible -- just speculating.)

   Finally, it's possible that the failure is occurring on the
   transmission end, perhaps due to an EOF character embedded in the
   source data or some such.

   On Aug 26, 5:40 pm, Achanta krishna.acha...@gmail.com wrote:

I am trying to get a JSON response from our server and the response
string seems is always being truncated when the string length reaches
to around 5525 characters.

HttpClient httpClient = new DefaultHttpClient();
HttpPost post = new HttpPost(URL);
ResponseHandlerString responseHandler= new BasicResponseHandler();
String testResponse = httpClient.execute(post, responseHandler);

I also tried this by using HttpEntity and reading the response stream.
But that also truncates the string at approximately that length.

            HttpClient httpClient = new DefaultHttpClient();
            HttpPost post = new HttpPost(URL);
//          HttpGet get = new HttpGet(URL);

            HttpResponse response = null;
            HttpEntity entity = null;
            InputStream inputStream = null;
            BufferedReader reader = null;
            String result = ;
            try {
                response = (HttpResponse)httpClient.execute(post);
                entity = response.getEntity();
                if(entity != null){
                    inputStream = entity.getContent();
                }
                reader = new BufferedReader(new
InputStreamReader(inputStream), 8000);
                StringBuffer builder = new StringBuffer();
                String line = reader.readLine();
                while(line != null){
                    Log.v(tag, int max: +Integer.MAX_VALUE);
                    Log.v(tag, LINE: +line
+reader.toString());
                    Log.v(tag, reader: +reader.toString());
                    builder.append(line+\n);
                    line = reader.readLine

[android-developers] String being truncated when its long

2010-08-26 Thread Achanta


I am trying to get a JSON response from our server and the response
string seems is always being truncated when the string length reaches
to around 5525 characters.

HttpClient httpClient = new DefaultHttpClient();
HttpPost post = new HttpPost(URL);
ResponseHandlerString responseHandler= new BasicResponseHandler();
String testResponse = httpClient.execute(post, responseHandler);

I also tried this by using HttpEntity and reading the response stream.
But that also truncates the string at approximately that length.

HttpClient httpClient = new DefaultHttpClient();
HttpPost post = new HttpPost(URL);
//  HttpGet get = new HttpGet(URL);

HttpResponse response = null;
HttpEntity entity = null;
InputStream inputStream = null;
BufferedReader reader = null;
String result = ;
try {
response = (HttpResponse)httpClient.execute(post);
entity = response.getEntity();
if(entity != null){
inputStream = entity.getContent();
}
reader = new BufferedReader(new
InputStreamReader(inputStream), 8000);
StringBuffer builder = new StringBuffer();
String line = reader.readLine();
while(line != null){
Log.v(tag, int max: +Integer.MAX_VALUE);
Log.v(tag, LINE: +line
+reader.toString());
Log.v(tag, reader: +reader.toString());
builder.append(line+\n);
line = reader.readLine();
}
inputStream.close();
result = builder.toString();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally{
if(inputStream != null){
try{
inputStream.close();
}catch(IOException e){
e.printStackTrace();
}
}
}

Please let me know how I can handle this problem. I used this post as
the reference while creating this.
http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/

I tested the link in my browser and it does return the complete JSON.
So I am sure the issue is with my code in android.

Thank you.

-- 
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: String being truncated when its long

2010-08-26 Thread Achanta
I Tested your suggestions by setting UTF-8 and I also tried the same
by removing the length 8000. But it still does the same thing.
Thank you for the response though.

This thing is driving me nuts.

On Aug 26, 4:58 pm, Jake Radzikowski radzikowski.j...@gmail.com
wrote:
 reader = new BufferedReader(new InputStreamReader(inputStream), 8000); I'm
 gunna guess that 8000 has something to do with it :). I usually use the
 following:

 reader = new BufferedReader(new InputStreamReader(inputStream, UTF-8));

 On Thu, Aug 26, 2010 at 3:40 PM, Achanta krishna.acha...@gmail.com wrote:

  I am trying to get a JSON response from our server and the response
  string seems is always being truncated when the string length reaches
  to around 5525 characters.

  HttpClient httpClient = new DefaultHttpClient();
  HttpPost post = new HttpPost(URL);
  ResponseHandlerString responseHandler= new BasicResponseHandler();
  String testResponse = httpClient.execute(post, responseHandler);

  I also tried this by using HttpEntity and reading the response stream.
  But that also truncates the string at approximately that length.

             HttpClient httpClient = new DefaultHttpClient();
             HttpPost post = new HttpPost(URL);
  //          HttpGet get = new HttpGet(URL);

             HttpResponse response = null;
             HttpEntity entity = null;
             InputStream inputStream = null;
             BufferedReader reader = null;
             String result = ;
             try {
                 response = (HttpResponse)httpClient.execute(post);
                 entity = response.getEntity();
                 if(entity != null){
                     inputStream = entity.getContent();
                 }
                 reader = new BufferedReader(new
  InputStreamReader(inputStream), 8000);
                 StringBuffer builder = new StringBuffer();
                 String line = reader.readLine();
                 while(line != null){
                     Log.v(tag, int max: +Integer.MAX_VALUE);
                     Log.v(tag, LINE: +line
  +reader.toString());
                     Log.v(tag, reader: +reader.toString());
                     builder.append(line+\n);
                     line = reader.readLine();
                 }
                 inputStream.close();
                 result = builder.toString();
             } catch (ClientProtocolException e) {
                 e.printStackTrace();
             } catch (IOException e) {
                 e.printStackTrace();
             } finally{
                 if(inputStream != null){
                     try{
                         inputStream.close();
                     }catch(IOException e){
                         e.printStackTrace();
                     }
                 }
             }

  Please let me know how I can handle this problem. I used this post as
  the reference while creating this.

 http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restfu...

  I tested the link in my browser and it does return the complete JSON.
  So I am sure the issue is with my code in android.

  Thank you.

  --
  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.comandroid-developers%2bunsubscr...@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] Re: String being truncated when its long

2010-08-26 Thread Achanta
Hi Jake,

I was actually doing this without the response handler. I tried that
one only when I started facing this problem. But the result is the
same.

On Aug 26, 5:21 pm, Jake Radzikowski radzikowski.j...@gmail.com
wrote:
 Could you try removing the responseHandler?

 On Thu, Aug 26, 2010 at 4:13 PM, Achanta krishna.acha...@gmail.com wrote:
  I Tested your suggestions by setting UTF-8 and I also tried the same
  by removing the length 8000. But it still does the same thing.
  Thank you for the response though.

  This thing is driving me nuts.

  On Aug 26, 4:58 pm, Jake Radzikowski radzikowski.j...@gmail.com
  wrote:
   reader = new BufferedReader(new InputStreamReader(inputStream), 8000);
  I'm
   gunna guess that 8000 has something to do with it :). I usually use the
   following:

   reader = new BufferedReader(new InputStreamReader(inputStream, UTF-8));

   On Thu, Aug 26, 2010 at 3:40 PM, Achanta krishna.acha...@gmail.com
  wrote:

I am trying to get a JSON response from our server and the response
string seems is always being truncated when the string length reaches
to around 5525 characters.

HttpClient httpClient = new DefaultHttpClient();
HttpPost post = new HttpPost(URL);
ResponseHandlerString responseHandler= new BasicResponseHandler();
String testResponse = httpClient.execute(post, responseHandler);

I also tried this by using HttpEntity and reading the response stream.
But that also truncates the string at approximately that length.

           HttpClient httpClient = new DefaultHttpClient();
           HttpPost post = new HttpPost(URL);
//          HttpGet get = new HttpGet(URL);

           HttpResponse response = null;
           HttpEntity entity = null;
           InputStream inputStream = null;
           BufferedReader reader = null;
           String result = ;
           try {
               response = (HttpResponse)httpClient.execute(post);
               entity = response.getEntity();
               if(entity != null){
                   inputStream = entity.getContent();
               }
               reader = new BufferedReader(new
InputStreamReader(inputStream), 8000);
               StringBuffer builder = new StringBuffer();
               String line = reader.readLine();
               while(line != null){
                   Log.v(tag, int max: +Integer.MAX_VALUE);
                   Log.v(tag, LINE: +line
+reader.toString());
                   Log.v(tag, reader: +reader.toString());
                   builder.append(line+\n);
                   line = reader.readLine();
               }
               inputStream.close();
               result = builder.toString();
           } catch (ClientProtocolException e) {
               e.printStackTrace();
           } catch (IOException e) {
               e.printStackTrace();
           } finally{
               if(inputStream != null){
                   try{
                       inputStream.close();
                   }catch(IOException e){
                       e.printStackTrace();
                   }
               }
           }

Please let me know how I can handle this problem. I used this post as
the reference while creating this.

   http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restfu.
  ..

I tested the link in my browser and it does return the complete JSON.
So I am sure the issue is with my code in android.

Thank you.

--
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.comandroid-developers%2bunsubscr...@googlegroups.com
  android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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.comandroid-developers%2bunsubscr...@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] remove Webview scroll margin

2010-08-24 Thread Achanta
I have a webview and i wanted it to occupy the whole screen but it
seems to have 7-8pix margin on the right side which is being used to
display the scroll bar.

Is there anyway I can remove that margin but still display the scroll
bars?
I want it to do it in the way GMail app layout is done.

Here is the layout that I am using
?xml version=1.0 encoding=UTF-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

WebView
android:id=@+id/web_view
android:layout_width=fill_parent
android:layout_height=fill_parent
/
/LinearLayout

I have tried setting the layout_marginRight=-8dip but that is a
hackish way and also takes the scrollbars off the screen making them
invisible.

Thank you

-- 
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: remove Webview scroll margin

2010-08-24 Thread Achanta
I have also tried setting scrollbar style to all the different styles
but it does not make a difference.
This thing is making my webviews look bad.
Please let me know if you have any suggestions on how to solve this.

On Aug 24, 10:43 am, Achanta krishna.acha...@gmail.com wrote:
 I have a webview and i wanted it to occupy the whole screen but it
 seems to have 7-8pix margin on the right side which is being used to
 display the scroll bar.

 Is there anyway I can remove that margin but still display the scroll
 bars?
 I want it to do it in the way GMail app layout is done.

 Here is the layout that I am using
 ?xml version=1.0 encoding=UTF-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     
     WebView
         android:id=@+id/web_view
         android:layout_width=fill_parent
         android:layout_height=fill_parent
     /
 /LinearLayout

 I have tried setting the layout_marginRight=-8dip but that is a
 hackish way and also takes the scrollbars off the screen making them
 invisible.

 Thank you

-- 
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: remove Webview scroll margin

2010-08-24 Thread Achanta
Thank you John,

It works.

But I have tried doing the same thing from the xml layout file.

I tried this
WebView
  android:id=@+id/webView1
  android:layout_height=fill_parent
  android:layout_width=fill_parent
  android:scrollbarStyle=insideOverlay /

Do you know why this does not work but still works when I do it from
the Java source?

Thanks again

-Achie.

On Aug 24, 1:48 pm, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 I use this style and it looks pretty good:

                 mywebview.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY) ;

 -John Coryat

-- 
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 in dialog is forcing the layout to fill the screen

2010-08-13 Thread Achanta
I have a mapview with location overlay items. Now when the user clicks
the overlay item pin/marker, I need to display a dialog with
corresponding people at that location.

Now since some places have more than one person at the same location,
I am trying to display them as a list. this part works fine.I want the
ListView Layout to be wrap_content[both width and height].  Now my
problem is that the height works fine and expands to the correct
height to display the list items, but the width always expands to the
width of the screen.

I have set all the widths in the list and the list items to be
wrap_content but it still does the same. So I removed all the list
items and tested it again and saw that it does it even when I have no
list items.

Now if I remove the list though and only use a single textview then it
works fine.

Here is my code that I use to inflate the layout.
LayoutInflater inflater =
(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout dialogLayout =
(LinearLayout)inflater.inflate(R.layout.location_list_dialog, null);

LayoutParams mapDialogParams = new LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
geoPoint, -1, -22,
LayoutParams.BOTTOM_CENTER);
mapView.addView(dialogLayout, mapDialogParams);

Can someone please let me know what I am doing wrong or how can I make
the listview to have the appropriate width as its children.

Thank you.


-- 
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] start activity from a overlay in maps

2010-07-22 Thread Achanta
I am trying to create a map application and I need to do something
similar to what Google Maps does.
I want to open show a list of locations and when user taps on them I
want to show a dialog.

I was able to do it till here. But now when the user clicks on the
dialog that opened I want to show another acttivity with the details
of that item that they clicked on.

I tried to start a new intent but it gives me an error.

Here is what I am doing

private void drawPopupWindow(Canvas canvas,int index, MapView mapView,
boolean shadow) {

OverlayItem item = mOverlays.get(index);
GeoPoint geoPoint = item.getPoint();

LayoutInflater inflater =
(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

LinearLayout dialogLayout =
(LinearLayout)inflater.inflate(R.layout.location_dialog, null);
LayoutParams mapDialogParams = new LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
geoPoint, -1, -22,
LayoutParams.BOTTOM_CENTER);
mapView.addView(dialogLayout, mapDialogParams);

dialogLayout.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
Intent detailIntent = new Intent(mContext, 
ItemDetailView.class);
mContext.startActivity(detailIntent); // I 
passed the context from
mapActivity
}
});

}

Here is the stack trace
E/AndroidRuntime( 4985): java.lang.RuntimeException: Unable to start
activity ComponentInfo{com.achie.test.mapssample/
com.achie.test.mapssample.ItemDetailView}:
android.view.InflateException: Binary XML file line #2: Error
inflating class unknown
E/AndroidRuntime( 4985):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2496)
E/AndroidRuntime( 4985):at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2512)
E/AndroidRuntime( 4985):at android.app.ActivityThread.access
$2200(ActivityThread.java:119)
E/AndroidRuntime( 4985):at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1863)
E/AndroidRuntime( 4985):at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 4985):at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 4985):at
android.app.ActivityThread.main(ActivityThread.java:4363)
E/AndroidRuntime( 4985):at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 4985):at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 4985):at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime( 4985):at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/AndroidRuntime( 4985):at dalvik.system.NativeStart.main(Native
Method)
E/AndroidRuntime( 4985): Caused by: android.view.InflateException:
Binary XML file line #2: Error inflating class unknown
E/AndroidRuntime( 4985):at
android.view.LayoutInflater.createView(LayoutInflater.java:513)
E/AndroidRuntime( 4985):at
android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
E/AndroidRuntime( 4985):at
android.view.LayoutInflater.inflate(LayoutInflater.java:385)
E/AndroidRuntime( 4985):at
android.view.LayoutInflater.inflate(LayoutInflater.java:320)
E/AndroidRuntime( 4985):at
android.view.LayoutInflater.inflate(LayoutInflater.java:276)
E/AndroidRuntime( 4985):at
com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:
198)
E/AndroidRuntime( 4985):at
android.app.Activity.setContentView(Activity.java:1622)
E/AndroidRuntime( 4985):at
com.achie.test.mapssample.ItemDetailView.onCreate(ItemDetailView.java:
11)
E/AndroidRuntime( 4985):at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
E/AndroidRuntime( 4985):at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2459)
E/AndroidRuntime( 4985):... 11 more
E/AndroidRuntime( 4985): Caused by:
java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 4985):at
com.google.android.maps.MapView.init(MapView.java:238)
E/AndroidRuntime( 4985):at
java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime( 4985):at
java.lang.reflect.Constructor.newInstance(Constructor.java:446)
E/AndroidRuntime( 4985):at
android.view.LayoutInflater.createView(LayoutInflater.java:500)
E/AndroidRuntime( 4985):... 20 more
E/AndroidRuntime( 4985): Caused by:
java.lang.IllegalArgumentException: MapViews can only be created
inside instances of MapActivity.
E/AndroidRuntime( 4985):at

[android-developers] Re: start activity from a overlay in maps

2010-07-22 Thread Achanta
Thank you guys,

Yes I had a mapView inside the other activity and it was my mistake
from copy paste. I was beating my head but thanks for pointing it out.

On Jul 22, 8:26 pm, Steve Howard ste...@android.com wrote:
 On Thu, Jul 22, 2010 at 10:32 AM, Achanta krishna.acha...@gmail.com wrote:
  E/AndroidRuntime( 4985): Caused by:
  java.lang.IllegalArgumentException: MapViews can only be created
  inside instances of MapActivity.

 Do you have a MapView not inside a MapActivity?

 Steve

-- 
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: Prevent application from showing up when dialing.

2010-06-22 Thread Achanta
That seems to work.

Although I did not understand what you meant by

Use new Intent(this, MyReallyScaryActivity.class) instead.

How do I replace
new Intent(Intent.ACTION_DIAL, Uri.parse(tel://911)); with what you
suggested?

Thank you anyway.


On Jun 17, 4:49 am, Mark Murphy mmur...@commonsware.com wrote:
 On Thu, Jun 17, 2010 at 12:41 AM, Achanta krishna.acha...@gmail.com wrote:
  But I just discovered that whenever I try to add another call when I
  am in a call, it promps me to complete the action using.
  1. my app
  2. The normal phone

  And when I click on my app, it just opens my app. I do not understand
  what is causing this and do not want my app to be shown in that list.

  Here is the snippet from manifest
         activity android:name=.MyActivity
                 android:label=@string/main_header
             intent-filter
                 action android:name=android.intent.action.DIAL /
                 category
  android:name=android.intent.category.DEFAULT /
             /intent-filter
         /activity

 Get rid of your intent-filter.

  and here is what I have in my onClick method of the emergency button.

                 Intent dial_911 = new Intent(Intent.ACTION_DIAL,
  Uri.parse(tel://911));
                 startActivity(dial_911);

 Use new Intent(this, MyReallyScaryActivity.class) instead.

 --
 Mark Murphy
 CommonsWare
 mmur...@commonsware.comhttp://commonsware.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: Prevent application from showing up when dialing.

2010-06-22 Thread Achanta
hmm I did not get this part.
 You do not want to use new Intent(Intent.ACTION_DIAL,
 Uri.parse(tel://911)), since that will trigger the built-in Dialer
 application. Moreover, you do not want to implement an ACTION_DIAL
 Intent filter, since you are not a Dialer application.

What I have in my app is an emergency number[911] button, which the
users can click. So when they click on it I want to show them the dial
menu with that number in it.
new Intent(Intent.ACTION_DIAL,Uri.parse(tel://911)) is doing that
for me. So I implemented it in this way. I also have a few other pages
which have other phone numbers and I am just replacing 911 with that
phone#.

I did what you said regarding removing intent filter and it is looking
fine. This is what I did not understand though.

 Hence, use an Intent that more directly identifies your desired activity to 
 start.

Can you tell me how I can replace [ new
Intent(Intent.ACTION_DIAL,Uri.parse(tel://911) ], with what you have
suggested to show the dial screen to the user with the number entered.

Thank you Mark.


On Jun 22, 2:13 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Jun 22, 2010 at 4:06 PM, Achanta krishna.acha...@gmail.com wrote:
  Although I did not understand what you meant by

 Use new Intent(this, MyReallyScaryActivity.class) instead.

  How do I replace
  new Intent(Intent.ACTION_DIAL, Uri.parse(tel://911)); with what you
  suggested?

 I'd use copy and paste, substituting in your Activity's class name for
 MyReallyScaryActivity. Actually, I notice now that you called it
 MyActivity in your sample code in your original message.

 You do not want to use new Intent(Intent.ACTION_DIAL,
 Uri.parse(tel://911)), since that will trigger the built-in Dialer
 application. Moreover, you do not want to implement an ACTION_DIAL
 Intent filter, since you are not a Dialer application. Hence, use an
 Intent that more directly identifies your desired activity to start.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training...At Your Office:http://commonsware.com/training

-- 
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: Prevent application from showing up when dialing.

2010-06-22 Thread Achanta
Not a problem at all,

Thanks for the help and clarifications.

On Jun 22, 4:10 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Tue, Jun 22, 2010 at 6:08 PM, Achanta krishna.acha...@gmail.com wrote:
  hmm I did not get this part.
  You do not want to use new Intent(Intent.ACTION_DIAL,
  Uri.parse(tel://911)), since that will trigger the built-in Dialer
  application. Moreover, you do not want to implement an ACTION_DIAL
  Intent filter, since you are not a Dialer application.

  What I have in my app is an emergency number[911] button, which the
  users can click. So when they click on it I want to show them the dial
  menu with that number in it.
  new Intent(Intent.ACTION_DIAL,Uri.parse(tel://911)) is doing that
  for me. So I implemented it in this way.

 Sorry, I messed up that part of my reply.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy

 Android Training...At Your Office:http://commonsware.com/training

-- 
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] Prevent application from showing up when dialing.

2010-06-16 Thread Achanta
My application has an emergency button which dials 911 when clicked
on.
Every thing on the app is working fine.
But I just discovered that whenever I try to add another call when I
am in a call, it promps me to complete the action using.
1. my app
2. The normal phone

And when I click on my app, it just opens my app. I do not understand
what is causing this and do not want my app to be shown in that list.

Here is the snippet from manifest
activity android:name=.MyActivity
android:label=@string/main_header
intent-filter
action android:name=android.intent.action.DIAL /
category
android:name=android.intent.category.DEFAULT /
/intent-filter
/activity

uses-permission android:name=android.permission.CALL_PHONE /

and here is what I have in my onClick method of the emergency button.

Intent dial_911 = new Intent(Intent.ACTION_DIAL,
Uri.parse(tel://911));
startActivity(dial_911);

why is this occuring and how can I prevent this from happening?

Thank you.

-- 
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] Standalone java code is not working in the same way from android.

2010-06-15 Thread Achanta
Hi,

I am trying to integrate Google Health on android and am trying to use
a client login example which is working fine as a standalone java
program. But when I implement the same in android it gives me all
these errors. I guess I am missing some saxparser
libraries.
Here is the code that I am using. I am using the same code that was
used in the example code provided by google for client login.
Can someone let me know where I am going wrong or what I am missing.

GoogleService myService = new GoogleService(
health,My Application);
myService.setUserCredentials(username,
password);

// Get a list of all entries
URL metafeedUrl = new URL(https://
www.google.com/health/feeds/
profile/list);
System.out.println(Getting Health profile
entries...\n);
Feed resultFeed =
myService.getFeed(metafeedUrl, Feed.class);
ListEntry entries = resultFeed.getEntries();
for(int i=0; ientries.size(); i++) {
Entry entry = entries.get(i);
System.out.println(\t +
entry.getTitle().getPlainText());
profilesString +=
entry.getTitle().getPlainText()+ \n;
}
And here are my referenced libraries.
gdata-core-1.0.jar
gdata-client-meta-1.0.jar
gdata-client-1.0.jar
gdata-health-meta-2.0.jar
gdata-health-2.0.jar
gdata-media-1.0.jar
jsr305.jar
google-collect-1.0-rc1.jar

And this is the error log that I get.
I/dalvikvm(10388): Could not find method
javax.xml.parsers.SAXParserFactory.getSchema, referenced from method
com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory
$SecureSAXParserFactory.getSchema
W/dalvikvm(10388): VFY: unable to resolve virtual method 12342:
Ljavax/
xml/parsers/SAXParserFactory;.getSchema ()Ljavax/xml/validation/
Schema;
D/dalvikvm(10388): VFY: replacing opcode 0x6e at 0x0002
D/dalvikvm(10388): Making a copy of Lcom/google/gdata/util/common/xml/
parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.getSchema code
(32 bytes)
W/dalvikvm(10388): VFY: unable to find class referenced in signature
(Ljavax/xml/validation/Schema;)
I/dalvikvm(10388): Could not find method
javax.xml.parsers.SAXParserFactory.setSchema, referenced from method
com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory
$SecureSAXParserFactory.setSchema
W/dalvikvm(10388): VFY: unable to resolve virtual method 12350:
Ljavax/
xml/parsers/SAXParserFactory;.setSchema (Ljavax/xml/validation/
Schema;)V
D/dalvikvm(10388): VFY: replacing opcode 0x6e at 0x0002
D/dalvikvm(10388): Making a copy of Lcom/google/gdata/util/common/xml/
parsing/SecureGenericXMLFactory$SecureSAXParserFactory;.setSchema code
(28 bytes)
W/XmlParser(10388): javax.xml.parsers.ParserConfigurationException:
org.xml.sax.SAXNotRecognizedException: 
http://xml.org/sax/features/external-parameter-entities
W/XmlParser(10388): javax.xml.parsers.ParserConfigurationException:
org.xml.sax.SAXNotRecognizedException: 
http://xml.org/sax/features/external-parameter-entities
W/XmlParser(10388): at
org.apache.harmony.xml.parsers.SAXParserFactoryImpl.newSAXParser(SAXParserFactoryImpl.java:
84)
W/XmlParser(10388): at
com.google.gdata.util.XmlParser.parse(XmlParser.java:682)
W/XmlParser(10388): at
com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
W/XmlParser(10388): at
com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
W/XmlParser(10388): at
com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:
68)
W/XmlParser(10388): at
com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:
39)
W/XmlParser(10388): at
com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:
100)
W/XmlParser(10388): at
com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:
52)
W/XmlParser(10388): at
com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:
66)
W/XmlParser(10388): at
com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:
34)
W/XmlParser(10388): at
com.google.gdata.client.Service.parseResponseData(Service.java:2165)
W/XmlParser(10388): at
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
W/XmlParser(10388): at
com.google.gdata.client.Service.getFeed(Service.java:1136)
W/XmlParser(10388): at
com.google.gdata.client.Service.getFeed(Service.java:998)
W/XmlParser(10388): at
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
W/XmlParser(10388): at
com.google.gdata.client.Service.getFeed(Service.java:1017)
W/XmlParser(10388): at
gh.com.achie.test.Health.getProfilesForUI(Health.java:60)
W/XmlParser(10388): at gh.com.achie.test.Main.onClick(Main.java:
33)
W/XmlParser(10388): at android.view.View.performClick(View.java:
2364)

[android-developers] Re: Standalone java code is not working in the same way from android.

2010-06-15 Thread Achanta
Thank you,

Is there any alternate way that I can try approaching or should I just
give up? I need to implement gdata client login for accessing google
health records.



On Jun 15, 12:13 pm, fadden fad...@android.com wrote:
 On Jun 15, 10:30 am, Achanta krishna.acha...@gmail.com wrote:

  I am trying to integrate Google Health on android and am trying to use
  a client login example which is working fine as a standalone java
  program. But when I implement the same in android it gives me all
  these errors. I guess I am missing some saxparser
  libraries.

 The problem is this:

  I/dalvikvm(10388): Could not find method 
  javax.xml.parsers.SAXParserFactory.getSchema, referenced from method 
  com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory 
  $SecureSAXParserFactory.getSchema
  I/dalvikvm(10388): Could not find method 
  javax.xml.parsers.SAXParserFactory.setSchema, referenced from method 
  com.google.gdata.util.common.xml.parsing.SecureGenericXMLFactory 
  $SecureSAXParserFactory.setSchema

 Looking at the Eclair version of SAXParserFactory:

 http://android.git.kernel.org/?p=platform/dalvik.git;a=blob;f=libcore...

 the definition of getSchema() is commented out, with the remark TODO
 No XSchema support in Android 1.0. Maybe later.

 So this won't work yet.

-- 
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 can we restrict apps to a country/region

2010-05-29 Thread Achanta
Hello,

I have my app in the market which is mainly for US based people as I
dont have the database that is required for any other country.

So I am wondering if it is possible to restrict the app to be visible
to and downloaded by only US based users.

Thank you.

-- 
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: Issue with setBuiltInZoomControls on HTC Incredible

2010-05-17 Thread Achanta
Even I have a very similar issue with all the webviews in our app.
None of the webviews display properly .
*They initially zoom in on loading and does not let me zoom out. I
cannot even scroll vertically or horizontally.
*When I click on a link it always selects another link that is way
below the one that I currently select.

I am also using the built in zoom controls.
The name of our app is iTriage if anyone with an incrediblw want to
test it. It works fine on all the other phones.
This issue is also causing the new users to leave bad ratings and is
damaging our app ratings.

This is the snippet of code that I am using in my app.
mWebView = (WebView) findViewById(R.id.web_view);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.loadUrl(url);
mWebView.getSettings().setBuiltInZoomControls(true);

Please let me know what might be causing this issue or how I might be
able to fix this.

Thank you.

On May 3, 9:21 pm, Felix fel...@gmail.com wrote:
 I use aWebViewto display JPGs to users. TheWebViewallows me to
 easily add zooming functionality without having to write the code to
 actually do it.

 Anyway, I've been getting a lot of Bug reports from users with an 
 HTCIncrediblethat the zooming is broken. I bought an HTCIncredible, and
 tested and sure enough zooming causes theWebViewto be surrounded by
 a box. It's difficult to explain, but basically panning and zooming is
 not possible. The only way I can get theWebViewto properly display
 the JPG is by setting setBuiltInZoomControls(false).

 I ran the app on another 2.1 phone (Droid), and it works fine. Works
 fine on my Nexus One, and even in the 2.1 Simulator.

 Anyone else run into this problem?

 Here's the code i have for myWebView:

 webview= (WebView) 
 findViewById(R.id.webview);webview.getSettings().setLoadsImagesAutomatically(true);webview.getSettings().setJavaScriptEnabled(true);webview.getSettings().setBuiltInZoomControls(true);webview.setInitialScale(initialScale);

 Then I just do:

 webview.loadUrl(file:// + getFilesDir() + / + filename);

 Thanks,
 Felix

 --
 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 
 athttp://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] Re: Issue with setBuiltInZoomControls on HTC Incredible

2010-05-17 Thread Achanta
Even I have a very similar issue with all the webviews in our app.
None of the webviews display properly .
*They initially zoom in on loading and does not let me zoom out. I
cannot even scroll vertically or horizontally.
*When I click on a link it always selects another link that is way
below the one that I currently select.

I am also using the built in zoom controls.
The name of our app is iTriage if anyone with an incrediblw want to
test it. It works fine on all the other phones.
This issue is also causing the new users to leave bad ratings and is
damaging our app ratings.

This is the snippet of code that I am using in my app.
mWebView = (WebView) findViewById(R.id.web_view);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new MyWebViewClient());
mWebView.loadUrl(url);
mWebView.getSettings().setBuiltInZoomControls(true);

Please let me know what might be causing this issue or how I might be
able to fix this.

Thank you.

On May 3, 9:21 pm, Felix fel...@gmail.com wrote:
 I use aWebViewto display JPGs to users. TheWebViewallows me to
 easily add zooming functionality without having to write the code to
 actually do it.

 Anyway, I've been getting a lot of Bug reports from users with an 
 HTCIncrediblethat the zooming is broken. I bought an HTCIncredible, and
 tested and sure enough zooming causes theWebViewto be surrounded by
 a box. It's difficult to explain, but basically panning and zooming is
 not possible. The only way I can get theWebViewto properly display
 the JPG is by setting setBuiltInZoomControls(false).

 I ran the app on another 2.1 phone (Droid), and it works fine. Works
 fine on my Nexus One, and even in the 2.1 Simulator.

 Anyone else run into this problem?

 Here's the code i have for myWebView:

 webview= (WebView) 
 findViewById(R.id.webview);webview.getSettings().setLoadsImagesAutomatically(true);webview.getSettings().setJavaScriptEnabled(true);webview.getSettings().setBuiltInZoomControls(true);webview.setInitialScale(initialScale);

 Then I just do:

 webview.loadUrl(file:// + getFilesDir() + / + filename);

 Thanks,
 Felix

 --
 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 
 athttp://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] Account authorization for Google Health on Android

2010-04-19 Thread Achanta
I am trying to access Google Health profile from android. What I want
to do is to let the users access their Google Health Profile and
modify it if they want to.

I saw the documentation and saw that we need to use either AuthSub or
OAuth for account authorization. I am not able to figure out which one
to use/how to implement them.

Can someone let me know how to do this authentication.

Thank you.

-- 
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: Android GData (Calendar)

2010-04-19 Thread Achanta
Hi Kumar,

 You can use the official gdata libraries from google. Whats stopping
 you?
I tried looking at the documentation and the code to see how I can
access Google Health from android but could not yet find a way.
Can you let me know How I can retrieve the user account info/token on
android.
Also how can I use this or atleast direct login[username/password] and
use them to connect to Google Health. the documentation says that we
need to register a domain with google health and use a signed request
but since I want to use it from an app, I am wondering if there is
another way to do this.

Atleast an example which connects to any of the google's other
services like mail/calendar etc., with a login or account
authentication might help.

thank you.


On Apr 3, 8:11 am, Kumar Bibek coomar@gmail.com wrote:
 You can use the official gdata libraries from google. Whats stopping
 you?
 This works quite well. There are some minor problem, but it works on
 android.

 Thanks and Regards,
 Kumar Bibek

 On Apr 2, 12:25 am, Johan johan.k...@gmail.com wrote:

  Hi

  I'm working on a program whose job is to parse a schema from a course
  at university (html) and synchronize it with a calendar in Google
  Calendar.
  A must-have requirements from the author is that the user must enter
  their user information (x...@gmail.com) then connect via the Calendar
  API to calendar services.
  ** The smartphone calendar via Intent is not okay to use **

  The main problem is that there is no GData (Dalvik Java) for Android.
  But I checked on GitHub and found that there seems to be something
  going on 
  com.google.wireless.gdata:http://android.git.kernel.org/?p=platform/external/gdata.git,a=summary
  Searched around and found some packets like simply-android-GData and
  GData on code.google.com, but none of them help with the structure of
  calendrar, and they can login to retrieve data rss, json, atom.

  So my question is then whether someone has a solution that works quite
  well as a possible. next update of the SDK will provide, a full GData
  API?

  Is it possible to compile a custom SDK from git and get with the
  functionality of git://android.git.kernel.org/platform/external/gdata.git?

  Or do you have any other solution that might work?

  Minimum functionality:
  View Calendars
  View Events
  Add Events
  Delete Events

  Happy Easter
  Johan

-- 
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 release an updated version of app with lower min sdk?

2010-04-01 Thread Achanta
We have an app thats running on 1.6 and higher but we want it to be
able to run on 1.5 also. So I tested the app with 1.5 and everything
works fine. So if I want to release this app can I release it as an
update for my older app with just changing

uses-sdk android:minSdkVersion=4 / to
uses-sdk android:minSdkVersion=3 /?

Will there be any problems if I do so?
Thank you.

-- 
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] Is this a joke or a spam or another April 1st prank?

2010-04-01 Thread Achanta
I just posted a message on this group and got this back to my mail
from some dreamhost.com.

Hope someone at Google looks into this.

But the fact is that it has been successfully posted and also got a
reply for it.
http://groups.google.com/group/android-developers/browse_thread/thread/9eb9d8803e88709a?hl=en#

Its annoying.

===
fromMail Delivery Subsystem nore...@dreamhost.com
to  k.@gmail.com
dateThu, Apr 1, 2010 at 10:37 AM
subject Your message was NOT received by android-
develop...@googlegroups.com!
mailed-by   kitty.g.dreamhost.com

hide details 10:37 AM (3 minutes ago)

We're sorry.. your email was unable to be processed by our automatic
support system, and so is being returned to you.

We could not find your email address in our customer database and so
couldn't accept your email. Due to the HUGE volume of spam we receive
at this address, we've been forced to implement this new policy.

Therefore, please just re-submit your message at:

  http://www.dreamhost.com/contact.cgi

All messages submitted through that form are guaranteed to be
received,
even if you aren't currently a customer!

Our apologies for the inconvenience,
--
The Happy DreamHost Support Team!

-- 
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] Re: Is this a joke or a spam or another April 1st prank?

2010-04-01 Thread Achanta
I got another mail saying this has not been delivered too and I don't
undertstand how someone else other than Google groups is sending me a
mail in reply to the mail I have sent.

On Apr 1, 10:45 am, Achanta krishna.acha...@gmail.com wrote:
 I just posted a message on this group and got this back to my mail
 from some dreamhost.com.

 Hope someone at Google looks into this.

 But the fact is that it has been successfully posted and also got a
 reply for 
 it.http://groups.google.com/group/android-developers/browse_thread/threa...

 Its annoying.

 ===
 from    Mail Delivery Subsystem nore...@dreamhost.com
 to      k.@gmail.com
 date    Thu, Apr 1, 2010 at 10:37 AM
 subject Your message was NOT received by android-
 develop...@googlegroups.com!
 mailed-by       kitty.g.dreamhost.com

 hide details 10:37 AM (3 minutes ago)

 We're sorry.. your email was unable to be processed by our automatic
 support system, and so is being returned to you.

 We could not find your email address in our customer database and so
 couldn't accept your email. Due to the HUGE volume of spam we receive
 at this address, we've been forced to implement this new policy.

 Therefore, please just re-submit your message at:

      http://www.dreamhost.com/contact.cgi

 All messages submitted through that form are guaranteed to be
 received,
 even if you aren't currently a customer!

 Our apologies for the inconvenience,
 --
 The Happy DreamHost Support Team!

-- 
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] Re: Can we release an updated version of app with lower min sdk?

2010-04-01 Thread Achanta
thank you Michael.

Still looking for someone to confirm it that it does not cause any
problems.

On Apr 1, 10:39 am, Michael Rueger mike.rue...@gmail.com wrote:
 On 4/1/2010 6:36 PM, Achanta wrote:

  We have an app thats running on 1.6 and higher but we want it to be
  able to run on 1.5 also. So I tested the app with 1.5 and everything
  works fine. So if I want to release this app can I release it as an
  update for my older app with just changing

       uses-sdk android:minSdkVersion=4 /  to
       uses-sdk android:minSdkVersion=3 /?

  Will there be any problems if I do so?

 We did that with our app it seems to work fine.

 Michael

-- 
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] Re: Is this a joke or a spam or another April 1st prank?

2010-04-01 Thread Achanta
That sucks,

But its does not sound right, because it says that it has not been
delivered to android-developers@googlegroups.com and then it links
back to their site. If its bounces of that email it should be received
by everyone in this group.

And moreover mine was a new post. So if it was a subscriber its to the
group and not to my post.


On Apr 1, 10:57 am, Michael Rueger mike.rue...@gmail.com wrote:
 On 4/1/2010 6:49 PM, Achanta wrote:

  I got another mail saying this has not been delivered too and I don't
  undertstand how someone else other than Google groups is sending me a
  mail in reply to the mail I have sent.

 could be one of the subscribers has an email that bounces with dreamhost
 and then is returned to the sender of the message.
 Same occasionally happens with vacation messages.

 Michael

-- 
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] Re: Can we release an updated version of app with lower min sdk?

2010-04-01 Thread Achanta
Thank you all for the replies.

I did test my app on a device working on 1.5 and it seems to be
working[so far]. Will do more testing though.

I was also searching for the blog post that Dianne was talking about
but could not find it. Can someone post a link for that blogpost.

Thank you.

On Apr 1, 12:56 pm, mike enervat...@gmail.com wrote:
 On 04/01/2010 11:33 AM, Dianne Hackborn wrote:

  Be careful means to test and run the app on the oldest version of
  the platform you support to make sure it works.

 Works is the key word here. I'm guessing that works doesn't mean
 the app started!. I assume that this means in reality full regression
 testing against every sdk.

  Just doing automated tests to make sure you are not calling any older
  APIs is not a guarantee you will work.

 No, sorry I didn't mean to imply it would. I was thinking more of a profiler
 that highlighted potentially unsafe areas so that you can check them to
 make certain that they're properly protected. What I'm most concerned
 about is inadvertent introduction of later sdk calls. Sort of an SDK lint.



  In addition, it is typical for an application to take advantage of
  Java class loading to be able to use newer APIs if they are available
  (see for example my blog post on the new service APIs), and I don't
  see any way an automated tool could accurately determine whether that
  code is safe on an older platform.

  You just need to make sure you test your app in the key environments
  it will run.

 Full regression testing is really onerous. The problem here is that it's
 really really easy to fall into the pit trap here that you find out too late
 (ie, in the field). And the problem is only going to get worse and worse
 as time goes on.

 I'll look for your article.

 Mike



  On Thu, Apr 1, 2010 at 11:05 AM, mike enervat...@gmail.com
  mailto:enervat...@gmail.com wrote:

      On 04/01/2010 10:53 AM, ~ TreKing wrote:

          On Thu, Apr 1, 2010 at 11:51 AM, Achanta
          krishna.acha...@gmail.com mailto:krishna.acha...@gmail.com
          mailto:krishna.acha...@gmail.com
          mailto:krishna.acha...@gmail.com wrote:

             Still looking for someone to confirm it that it does not cause
             any problems.

          Um ... didn't Michael just do that?
          There is no specific problem with what you're doing, except of
          course properly testing all supported versions and being
          careful if / how you use APIs that did not exist on 1.5.

      Here's the question I have: define be careful. If be careful means
      inspecting every class/method call you make against SDK level, I think
      you're setting yourself up for failure, as it's extremely easy to
      miss that,
      and the only time you find it is at run time, which for a seldom
      run piece
      of code could be pretty elusive.

      It's would be a lot better to be careful by having some tool --
      maybe in
      the android dev tool chain or the eclipse plugin -- that
      carefully goes
      through your code looking for method/classes that are below the
      current
      SDK level. I'm sure there are even better ways to be careful.

      But as it right now, be careful is just a big smelly hack.

      Mike

      --
      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
      mailto:android-developers@googlegroups.com
      To unsubscribe from this group, send email to
      android-developers+unsubscr...@googlegroups.com
      mailto:android-developers%2bunsubscr...@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.

  --
  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



-- 
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: Can we release an updated version of app with lower min sdk?

2010-04-01 Thread Achanta
Its regarding the same issue but also related to analytics tracking.

So I analytics referrals work for android 1.6 and higher[from the
documentation]. So will this part cause any issues on 1.5.
  receiver
android:name=com.google.android.apps.analytics.AnalyticsReceiver
android:exported=true
intent-filter
  action android:name=com.android.vending.INSTALL_REFERRER /
/intent-filter
  /receiver
I have added the jar and this code to my manifest but I am not sure if
this will cause any problems after releasing it into market.



On Apr 1, 1:10 pm, Achanta krishna.acha...@gmail.com wrote:
 Thank you all for the replies.

 I did test my app on a device working on 1.5 and it seems to be
 working[so far]. Will do more testing though.

 I was also searching for the blog post that Dianne was talking about
 but could not find it. Can someone post a link for that blogpost.

 Thank you.

 On Apr 1, 12:56 pm, mike enervat...@gmail.com wrote:

  On 04/01/2010 11:33 AM, Dianne Hackborn wrote:

   Be careful means to test and run the app on the oldest version of
   the platform you support to make sure it works.

  Works is the key word here. I'm guessing that works doesn't mean
  the app started!. I assume that this means in reality full regression
  testing against every sdk.

   Just doing automated tests to make sure you are not calling any older
   APIs is not a guarantee you will work.

  No, sorry I didn't mean to imply it would. I was thinking more of a profiler
  that highlighted potentially unsafe areas so that you can check them to
  make certain that they're properly protected. What I'm most concerned
  about is inadvertent introduction of later sdk calls. Sort of an SDK lint.

   In addition, it is typical for an application to take advantage of
   Java class loading to be able to use newer APIs if they are available
   (see for example my blog post on the new service APIs), and I don't
   see any way an automated tool could accurately determine whether that
   code is safe on an older platform.

   You just need to make sure you test your app in the key environments
   it will run.

  Full regression testing is really onerous. The problem here is that it's
  really really easy to fall into the pit trap here that you find out too late
  (ie, in the field). And the problem is only going to get worse and worse
  as time goes on.

  I'll look for your article.

  Mike

   On Thu, Apr 1, 2010 at 11:05 AM, mike enervat...@gmail.com
   mailto:enervat...@gmail.com wrote:

       On 04/01/2010 10:53 AM, ~ TreKing wrote:

           On Thu, Apr 1, 2010 at 11:51 AM, Achanta
           krishna.acha...@gmail.com mailto:krishna.acha...@gmail.com
           mailto:krishna.acha...@gmail.com
           mailto:krishna.acha...@gmail.com wrote:

              Still looking for someone to confirm it that it does not cause
              any problems.

           Um ... didn't Michael just do that?
           There is no specific problem with what you're doing, except of
           course properly testing all supported versions and being
           careful if / how you use APIs that did not exist on 1.5.

       Here's the question I have: define be careful. If be careful means
       inspecting every class/method call you make against SDK level, I think
       you're setting yourself up for failure, as it's extremely easy to
       miss that,
       and the only time you find it is at run time, which for a seldom
       run piece
       of code could be pretty elusive.

       It's would be a lot better to be careful by having some tool --
       maybe in
       the android dev tool chain or the eclipse plugin -- that
       carefully goes
       through your code looking for method/classes that are below the
       current
       SDK level. I'm sure there are even better ways to be careful.

       But as it right now, be careful is just a big smelly hack.

       Mike

       --
       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
       mailto:android-developers@googlegroups.com
       To unsubscribe from this group, send email to
       android-developers+unsubscr...@googlegroups.com
       mailto:android-developers%2bunsubscr...@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.

   --
   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

Re: [android-developers] Re: Can we release an updated version of app with lower min sdk?

2010-04-01 Thread Krishna Achanta
No it did not cause any problems on either the device[htc hero] or the
emulator.
I am asking because this part of the code may come into picture when the app
is being downloaded from the market and i am not sure if that causes any
problems.

On Thu, Apr 1, 2010 at 2:33 PM, ~ TreKing treking...@gmail.com wrote:

 On Thu, Apr 1, 2010 at 2:54 PM, Achanta krishna.acha...@gmail.com wrote:

 I have added the jar and this code to my manifest but I am not sure if
 this will cause any problems after releasing it into market.


 Did this cause any problems on an emulator or device running 1.5?



 -
 TreKing - Chicago transit tracking app for Android-powered devices
 http://sites.google.com/site/rezmobileapps/treking

 --
 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.comandroid-developers%2bunsubscr...@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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: Is this a joke or a spam or another April 1st prank?

2010-04-01 Thread Achanta
yeah I think it is a spam as far as we are concerned but I hope the
guys at Google will take care of this annaoying mails..
I just marked those as spam for now.

On Apr 1, 9:17 pm, David Orriss Jr codethou...@gmail.com wrote:
 Since I just got your email via the list I'd say yes.. :-)

 On Apr 1, 2010, at 8:14 PM, Stanley Li wrote:

  I got this message too. So if I got this message, can i still send emails 
  to the group and everyone can receive my email?

  On Thu, Apr 1, 2010 at 7:28 PM, David Orriss Jr codethou...@gmail.com 
  wrote:
  Yea that email is annoying.. to say the least... :|



-- 
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] Problem with setting progress indeterminate when using webView

2010-03-29 Thread Achanta
I am trying to use a webview to display a webpage and let the users to
browse from the same WebView. I want to show them a progress
indeterminate when loading the pages. This works to an extent with the
code below but there is a bug in this code which I am not able to fix.
It displays the progress indeterminate correctly the first time the
page loads. But when clicked on the links it sometimes works fine and
sometimes it stops immediately though the WebView is still loading.
Can someone tell me what I am doing wrong or any other better way to
do this.
Here is the entire code.

Thank you.

package browser.com.achie;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebView2 extends Activity {

private final String tag = ## WEBVIEW  ;
String url = http://developer.android.com/index.html;;
WebView mWebView;
MyHandler mHandler = null;
ProgressThread progressThread;

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


mWebView = (WebView) findViewById(R.id.web_view);
mWebView.getSettings().setJavaScriptEnabled(true);

mWebView.setWebViewClient(new MyWebViewClient());
mWebView.loadUrl(url);

mHandler = new MyHandler();
progressThread = new ProgressThread(mHandler);
mHandler.startThread();
}


private class MyHandler extends Handler{
MyHandler(){
}

public synchronized void startThread(){
Log.v(tag, starting thread from handler ##);
setProgressBarIndeterminateVisibility(true);
progressThread.setState(ProgressThread.STATE_RUNNING);
progressThread.start();
}

public synchronized void stopThread(){
Log.v(tag, stopping thread from handler ##);
if(progressThread != null){
progressThread.setState(ProgressThread.STATE_DONE);
}
setProgressBarIndeterminateVisibility(false);
}

public synchronized void handleMessage(Message msg){
int total = msg.getData().getInt(total);
if(total = 100){
stopThread();
}
}
}

private class ProgressThread extends Thread{
Handler mHandler;
final static int STATE_DONE = 0;
final static int STATE_RUNNING = 1;
int mState;

ProgressThread(Handler h){
mHandler = h;
}

public synchronized void run(){
mState = STATE_RUNNING;
int messagesSent = 0;
while (mState == STATE_RUNNING){
try{
Thread.sleep(200);
}catch(InterruptedException e){
Log.e(ERROR: , Thread Interrupted);
}
Log.v(Progress of the webView,  is :  +
mWebView.getProgress());
if(messagesSent ==0  mWebView.getProgress()==100){
messagesSent++;
Message msg = mHandler.obtainMessage();
Bundle b = new Bundle();
b.putInt(total, 100);
msg.setData(b);
mHandler.sendMessage(msg);
break;
}
}
}

/*
 * Sets the current state for the thread,
 * Used to stop the thread
 */
public void setState(int state){
Log.v(Setting state as: ,  :  + 
state);
mState = state;
}
}

private class MyWebViewClient extends WebViewClient{
//  ProgressThread zProgressThread;
MyHandler myHandler;
@Override
public synchronized boolean shouldOverrideUrlLoading(WebView 
view,
String url){
view.loadUrl(url);

if(myHandler == null){
myHandler = new MyHandler();
}
//  if(progressThread != null){
//  zHandler.stopThread();
//  }
progressThread = new ProgressThread(myHandler);
myHandler.startThread();
return true;
}

}

public boolean 

[android-developers] Re: Activity lifecycle problem on Nexus One - onStop not called

2010-03-12 Thread Achanta
So I have modified my thread to be a singleton and mimplemented it
like this. Hope it helps someone else who might be facing the same
issue.

public class SingletonThread extends Thread{
private static SingletonThread _instance;
public static boolean IS_RUNNING = false;
private static Context mContext;

private SingletonThread(){
}

public synchronized static final SingletonThread getInstance(Context
context){
mContext = context;
if(instance == null){
instance = new SingletonThread();
}
return instance;
}

public synchronized void run(){
IS_RUNNING = true;
//Implement your requirements.
IS_RUNNING = false;
}
}

And whenever I call the getInstance, from any other UI thread, I will
check for IS_RUNNING also and will start the thread only if IS_RUNNING
is false/will wait till IS_RUNNING is false.

There might be better ways to do this, so please post your feedbacks,

Thank you.


On Mar 11, 2:44 pm, Dianne Hackborn hack...@android.com wrote:
 On Thu, Mar 11, 2010 at 1:40 PM, Achanta krishna.acha...@gmail.com wrote:
  Yes I am trying to redesign it to use AsyncTask. One reason why I did
  not take this approach is that I just wanted a plain thread that sits
  and logs user events that are occurring throughout my app and it made
  more sense to just start that thread when the app starts and shut it
  down when the app closes. I had a handler which grabs the logs and
  puts them in db and the thread just sits there and logs them to
  server.

 For this model, manage the thread through a separate static singleton, have
 clients tell it when they are using it (in onCreate() or whatever) and when
 they are done (in onDestroy() or whatever), and have that class take care of
 stopping the thread when there are no more clients.

 Also please be careful about what this thread is doing.  An application
 should be careful to be doing very little work any time it is not in the
 foreground, or it will be consuming battery...  and has a good chance of
 showing up high up in the battery meter as it eats the user's battery.

 --
 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] Re: Activity lifecycle problem on Nexus One - onStop not called

2010-03-11 Thread Achanta
Thank you Dianne,

Its not even passing onStop and onDestroy at some point in the future.
It is only doing it in some point in the future when more activities
are started. I tested it 4-5 times and let it run for atleast 5
minutes. So I don't know how long I have to wait for the thread to
close.

Can anyone suggest a work around for this issue.
I have a background thread which starts in the onCreate methos and
which I close in the onDestroy method. But because of this bug in the
sdk 2.1 my thread never stops. But when the user closes the
app[onDestroy hasn't been called] and opens my application again, I
try to create the thread in the onCreate. But after this is done at
some point the onDestroy from the earlier activity is called which
sends a messahe to my thread's handler to stop the thread. So the app
runs now but the background thread doesnot run.

Another problem that I face with the same issue is since the handle
passes the message to stop the thread even while it is supposed to
run, my events trigger actions where i have to write to database from
the background thread. Now since that is null it shows the force close
message.

The only option that I see is to detect the build version each time my
app starts and try to limit the things the user can do in those
versions, which ofcourse is not much more than just undesirable
thing.

Please let me know if anyone has a workaround for this one.

thank you.

-- 
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: Activity lifecycle problem on Nexus One - onStop not called

2010-03-11 Thread Achanta
Thank you Mark,

Yes I am trying to redesign it to use AsyncTask. One reason why I did
not take this approach is that I just wanted a plain thread that sits
and logs user events that are occurring throughout my app and it made
more sense to just start that thread when the app starts and shut it
down when the app closes. I had a handler which grabs the logs and
puts them in db and the thread just sits there and logs them to
server.

I saw the google tracker but the apis for analytics are not yet good
enough to provide us all the data which we can integrate into our
marketing tools.

I still hope this issue will be resolved soon.

On Mar 11, 2:26 pm, Mark Murphy mmur...@commonsware.com wrote:
 Achanta wrote:
  Can anyone suggest a work around for this issue.
  I have a background thread which starts in the onCreate methos and
  which I close in the onDestroy method. But because of this bug in the
  sdk 2.1 my thread never stops. But when the user closes the
  app[onDestroy hasn't been called] and opens my application again, I
  try to create the thread in the onCreate. But after this is done at
  some point the onDestroy from the earlier activity is called which
  sends a messahe to my thread's handler to stop the thread. So the app
  runs now but the background thread doesnot run.

 You may be able to redesign your application to not require a permanent
 background thread. For example, use discrete AsyncTasks that do some
 work and end.

  Another problem that I face with the same issue is since the handle
  passes the message to stop the thread even while it is supposed to
  run, my events trigger actions where i have to write to database from
  the background thread. Now since that is null it shows the force close
  message.

 I have no idea what this means.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Training in US: 14-18 June 2010:http://bignerdranch.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: Activity lifecycle problem on Nexus One - onStop not called

2010-03-11 Thread Achanta
Hey Dianne,

Thank you for the tip on battery life. Will definitely try to make it
as good as possible for the battery life.

Yes I considered using singleton pattern but again I still face with
the issue where onDestroy will be called after onCreate when it should
not happen and I need to keep track of that case also. So I would just
go with AsynkTask but take care that my app is not eating up the
battery.

Thank you.

On Mar 11, 2:44 pm, Dianne Hackborn hack...@android.com wrote:
 On Thu, Mar 11, 2010 at 1:40 PM, Achanta krishna.acha...@gmail.com wrote:
  Yes I am trying to redesign it to use AsyncTask. One reason why I did
  not take this approach is that I just wanted a plain thread that sits
  and logs user events that are occurring throughout my app and it made
  more sense to just start that thread when the app starts and shut it
  down when the app closes. I had a handler which grabs the logs and
  puts them in db and the thread just sits there and logs them to
  server.

 For this model, manage the thread through a separate static singleton, have
 clients tell it when they are using it (in onCreate() or whatever) and when
 they are done (in onDestroy() or whatever), and have that class take care of
 stopping the thread when there are no more clients.

 Also please be careful about what this thread is doing.  An application
 should be careful to be doing very little work any time it is not in the
 foreground, or it will be consuming battery...  and has a good chance of
 showing up high up in the battery meter as it eats the user's battery.

 --
 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] Re: Activity lifecycle problem on Nexus One - onStop not called

2010-03-10 Thread Achanta
I too have the same issue and Mark, we discussed it earlier in another
thread. I was trying to use the onStop and onDestroy to stop Location
updates and other background threads that I start from onCreate
method.

Here is what I observed.

Here is what I have seen. I am using Nexus one [2.1].
Pressing on Home button or the Back button from my main activity does
not call the onStop method or onDestroy method in this case
Activities A, B.
Activity A has a Button which starts activity B.

Now when the activity A is started normally and it does not start
another thread then the Back button from Activity A is called onStop
and onDestroy.
But if the Activity B is started from Activity A or if there is
another thread that has been started from Activity A and if we come
back to Activity A from Activity B and then press on the Back button,
then onStop and onDestroy are not immediately called. But they are
called after some other activity/application are opened.
I even observed that they are not always immediately called after
opening the same activity A. Sometimes they are called after activity
A starts Activity B.

1. start A
 Press Back.
 onStop and onDwstroy called.

2. start A.
   Start another thread or activity from A and come back to A.
   Click on Back Button From A.
   onStop and onDestroy are not called.
   Start another application or the same application.
   onStop and onDestroy are sometimes[not always immediately] called.
   start opening more activities.
   onStop and onDestroy will be called at some point.

3. Start Activity A.
   Click on Home button.
   onStop is never called. [or atleast on two nexus one phones that I
tested atleast a few times].
 it will be called at a later point when another application or the
same application is opened. And just like onStop, this is not in any
predicted manner but is called at some point.


On Mar 10, 10:07 am, Alex acni...@gmail.com wrote:
 I'm having a similar lifecycle issue on the Nexus One.

 Start the app -OnCreate
 Hitback- no OnDestroy is called
 Run app again -OnCreate, followed by OnDestroy

 The wierd thing is that it doesn't actually kill our application, so
 it is left in a broken state since we are tearing things down in
 OnDestroy.

 -Alex

 On Mar 7, 11:27 am, skyhigh skyhigh1...@gmail.com wrote:

  Very few of my activities used onStart and onStop until recently when
  I instrumented my application with Flurry Analytics.  If you follow
  the Flurry instrumentation instructions then you add calls to notify
  Flurry about your application activity in the onStart and onStop
  methods for everyoneof your activities.  I am not sure what impact
  it will have on the Flurry statistics gathering if these routines
  don't get called.

  I have had users reporting problems with my application on 2.1 phones
  which may be related to the service life cycle not behaving properly
  on these phones.  I don't currently have a 2.1 phone to test this on
  (I am waiting to get my device seeding phone).  I built an
  instrumented beta build that will log the service life cycle
  information for me, and am waiting for a customer to run the
  instrumented beta build on their 2.1 phone and send mebackthe
  logcat, so I can see if there is a similar issue with services.



-- 
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: new certificate for the apk

2010-02-24 Thread Achanta

Thank you Bob for the feedback,

I am afraid I do not have the private key since I do not have the
keystore. I guess I need to figure out how to let all the old users
know about my new app now.

Thank you again.


On Feb 24, 9:01 am, Bob Kerns r...@acm.org wrote:
 One other small point -- in theory, if you got every detail exactly
 right, you could even reproduce your original certificate, so long as
 you still have that original private key.

 Or you could recover the certificate from a copy of the product.

 It's the private key you have to guard with your life. I hope you
 still have that.

 I hope I didn't put everybody to sleep. I know I put MYSELF to
 sleep... :)

-- 
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] new certificate for the apk

2010-02-23 Thread Achanta
I do not have the keystore that I used when I first created the app
and I am wondering if I can create a new certificate using the same
details that I used to create the earlier certificate. I have the
details available with me.

If I do so and update the app using this certificate, will the users
get an update notification on their device?

Thank you.

-- 
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: new certificate for the apk

2010-02-23 Thread Achanta
Thank you Mark for the reply,

So I guess I am at a loss here. But what would be the best way to go
ahead?Can you weigh the options.

Thanks.

On Feb 23, 6:01 pm, Mark Murphy mmur...@commonsware.com wrote:
 Achanta wrote:
  I do not have the keystore that I used when I first created the app
  and I am wondering if I can create a new certificate using the same
  details that I used to create the earlier certificate. I have the
  details available with me.

  If I do so and update the app using this certificate, will the users
  get an update notification on their device?

 No. In fact, you won't even be able to upload the update to the Android
 Market. A signing key is not a hash of the input -- it's a uniquely
 generated key pair. If you lost it, you are out of luck.

 To others reading this thread: if you have apps on the Market that you
 care about, BACK UP YOUR PRODUCTION SIGNING KEY!

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|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


[android-developers] Re: How to close an activity when the user clicks on home button

2010-02-20 Thread Achanta

 I just tried it on an app I'm working on (Android 2.1), and onStop() was
 called at the point I pressed the HOME button.

I am using Android 1.6 as I need to support all the phones which are
working on that version also. And in this version or atleast for my
situation its not working so.


 Are you doing anything unusual in your manifest vis a via
 android:launchMode or similar settings?
Yes I was using launchMode=singleTask. I actually wanted
singleInstance but somehow Voice recognizer is giving a connection
problem when I use singleInstance.

So just to see if it is working in the way you suggested, I tried
removing all the launchMode etc in manifest and just left the activity
name and label. This time onStop method or the onRestart method are
never ever called.

But these are being called when I set finishTaskOnLaunch to true in
the manifest.

Thank you anyway for the help and the suggestions. I atleast got it to
work to the most extent if not stopping the updates and the activity
on clicking home button.

  The other thing is that I expected my stack to be as it is and as soon
  as I open my app after hitting on home button, the activity which I
  was previously in will be opened. But it restarted the app itself.

  This is what I observed in my app.
  Say I have a main activity A and another Activity B.
  I come to Activity B from Activity A.
  Then I click on home button.
  It closes the app but does not yet call onStop on B.
  Now I open my app and it now calls onStop on Activity B.
  It starts Activity A again.
  Now only when I click on button for activity B, it calls onRestart
  method on Activity B.

 I just tried it with this same scenario (Activity A - Activity B -
 HOME), and again, onStop() was called at the point I pressed HOME.

  So am I doing something wrong or is it supposed to work in that way or
  is it a bug?

 Well, there appears to be something afoot either with your app or with
 your environment. onStop(), at least as of Android 2.1, seems to behave
 as documented for fairly ordinary stuff. Mind you that my test code does
 not mess with android:launchMode or flags on activity starting or
 whatever, so if you are, that's something to experiment with.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Development Wiki:http://wiki.andmob.org

-- 
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 close an activity when the user clicks on home button

2010-02-20 Thread Achanta
Thankyou,

I needed finishTaskonLaunch as that is more suitable than
clearTaskOnLaunch for my case as I need to close the activity itself
which I am opening in a separate task.

On Feb 20, 10:56 am, intbt in...@tacberry.com wrote:
 it may be as simple as adding

 android:clearTaskOnLaunch=true

 in your Manifest under the main activity tag to re-initialize after
 returning to Home screen.

 intbt

 On Feb 20, 4:54 am, Mark Murphy mmur...@commonsware.com wrote:

  Achanta wrote:
   But since I started trying to log everything to see the activity life
   cycle, what I observed is that onStop method is not actually being
   called when I click on home button.

  :: blink, blink ::

   Its being called as soon as i open
   my app again, which is not how I wanted it to do. The locationUpdates
   should stop the moment the user hits home button.

  I just tried it on an app I'm working on (Android 2.1), and onStop() was
  called at the point I pressed the HOME button.

  Are you doing anything unusual in your manifest vis a via
  android:launchMode or similar settings?

   The other thing is that I expected my stack to be as it is and as soon
   as I open my app after hitting on home button, the activity which I
   was previously in will be opened. But it restarted the app itself.

   This is what I observed in my app.
   Say I have a main activity A and another Activity B.
   I come to Activity B from Activity A.
   Then I click on home button.
   It closes the app but does not yet call onStop on B.
   Now I open my app and it now calls onStop on Activity B.
   It starts Activity A again.
   Now only when I click on button for activity B, it calls onRestart
   method on Activity B.

  I just tried it with this same scenario (Activity A - Activity B -
  HOME), and again, onStop() was called at the point I pressed HOME.

   So am I doing something wrong or is it supposed to work in that way or
   is it a bug?

  Well, there appears to be something afoot either with your app or with
  your environment. onStop(), at least as of Android 2.1, seems to behave
  as documented for fairly ordinary stuff. Mind you that my test code does
  not mess with android:launchMode or flags on activity starting or
  whatever, so if you are, that's something to experiment with.

  --
  Mark Murphy (a Commons 
  Guy)http://commonsware.com|http://twitter.com/commonsguy

  Android Development Wiki:http://wiki.andmob.org



-- 
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 close an activity when the user clicks on home button

2010-02-19 Thread Achanta
I understand that trying to capture home button clicks is a hack, but
I need to atleast close my current activity when the user clicks on
home button.
Is there anyway I can tell the system to close this activity is the
user clicks on home button? If so how can I do that?

I need to do it as I am listening for location updates and I want to
stop the updates and also need to trash any location that was
available to me previously.
I need to do this just in case any user while in that activity clicks
on home button and changes the location settings.

Thank you

-- 
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 close an activity when the user clicks on home button

2010-02-19 Thread Achanta
Thank you Mark,

I do know that I can you onStop method as it is supposed to be called
when ever something else comes on to the screen (in this case the home
page). But my situation is a little more complicated than that.

I have an address field and an option for gps[if its switched on]. But
in the bottom portion of the screen I will be loading my results based
on the location. Now since I have loaded the results using the
onCreate, its doing so. So I changed it to do all those things in the
onStart method so that the Activity life cycle goes on smoothly.

Thanks for the suggestion because of which I went through my
Activity's lifecycle to see how everything is going on.

But since I started trying to log everything to see the activity life
cycle, what I observed is that onStop method is not actually being
called when I click on home button. Its being called as soon as i open
my app again, which is not how I wanted it to do. The locationUpdates
should stop the moment the user hits home button.

The other thing is that I expected my stack to be as it is and as soon
as I open my app after hitting on home button, the activity which I
was previously in will be opened. But it restarted the app itself.

This is what I observed in my app.
Say I have a main activity A and another Activity B.
I come to Activity B from Activity A.
Then I click on home button.
It closes the app but does not yet call onStop on B.
Now I open my app and it now calls onStop on Activity B.
It starts Activity A again.
Now only when I click on button for activity B, it calls onRestart
method on Activity B.

So am I doing something wrong or is it supposed to work in that way or
is it a bug?

On Feb 19, 2:52 pm, Mark Murphy mmur...@commonsware.com wrote:
 Achanta wrote:
  I understand that trying to capture home button clicks is a hack, but
  I need to atleast close my current activity when the user clicks on
  home button.

 snip

  I need to do it as I am listening for location updates and I want to
  stop the updates and also need to trash any location that was
  available to me previously.

 Then stop location updates in onStop(). This will get invoked:

 -- when the user presses HOME
 -- when the user pressed BACK (en route to onDestroy())
 -- when the user takes a phone call
 -- when the user responds to a notification that brings up an activity
 -- etc.

 The one thing you may want to do is handle configuration changes
 yourself, so you won't be called with onStop() when the user rotates the
 screen.

  I need to do this just in case any user while in that activity clicks
  on home button and changes the location settings.

 I'm not sure what the location settings are. If you mean they disable
 GPS, your LocationListener should be notified of that.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|http://twitter.com/commonsguy

 Android Training in US: 26-30 April 2010:http://onlc.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] Prevent EditText focus

2010-02-15 Thread Achanta
How can we prevent an edittext from getting focus and displaying the
soft keyboard.

I have an searchbox which should not be focussed by default and should
have focus only when user clicks on it to enter something. But right
now it takes focus and shows the keyoard as soon as I open the
activity.

Is this a bug or can this be changed to behave in the way we want?

-- 
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 show a loading image or an animation?

2010-02-04 Thread Achanta
Hey Tope,

thank you for posting it.

I could not work on this till now but will start using your code. I
hope it will do what I need.
Thanks again for atleast getting me started on this thing.

Achie.

On Feb 1, 4:35 pm, Temitope Akinwande takinwa...@gmail.com wrote:
 So here is an example I created by following this 
 tutorialhttp://developer.android.com/intl/fr/guide/topics/ui/dialogs.html
 under the heading Example ProgressDialog with a second thread

 I modified it a little to load a webpage and use the progress of the
 page to display/dismiss the dialog

 package com.test.progressdialog;

 import android.app.Activity;
 import android.app.Dialog;
 import android.app.ProgressDialog;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.util.Log;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.webkit.WebView;
 import android.widget.Button;

 public class ProgressDialogTest extends Activity {
     static final int PROGRESS_DIALOG = 0;
     ProgressThread progressThread;
     ProgressDialog progressDialog;

     private Button mButton;
     private WebView mWebView;

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

         mButton = (Button) findViewById(R.id.progressDialog);
         mWebView = (WebView) findViewById(R.id.content);
         mButton.setOnClickListener(new OnClickListener() {
             public void onClick(View v) {
                 mButton.setVisibility(View.GONE);
                 mWebView.loadUrl(http://en.m.wikipedia.org/wiki/::Home;);
                 showDialog(PROGRESS_DIALOG);
             }
         });
     }

         protected Dialog onCreateDialog(int id) {
             switch(id) {
                 case PROGRESS_DIALOG:
                     progressDialog = new
 ProgressDialog(ProgressDialogTest.this);
                     progressDialog.setMessage(Loading...);
                     progressDialog.setIndeterminate(true);
                     progressThread = new ProgressThread(handler);
                     progressThread.start();
                     return progressDialog;
                 default:
                     return null;
             }
         }

         // Define the Handler that receives messages from the thread
 and update the progress
         final Handler handler = new Handler() {
             public void handleMessage(Message msg) {
                 int total = msg.getData().getInt(total);
                 if (total = 100) {
                     dismissDialog(PROGRESS_DIALOG);
                     progressThread.setState(ProgressThread.STATE_DONE);
                 }
             }
         };

         /** Nested class that performs progress calculations (counting) */
         private class ProgressThread extends Thread {
             Handler mHandler;
             final static int STATE_DONE = 0;
             final static int STATE_RUNNING = 1;
             int mState;

             ProgressThread(Handler h) {
                 mHandler = h;
             }

             public void run() {
                 mState = STATE_RUNNING;
                 //total = 0;
                 while (mState == STATE_RUNNING) {
                     try {
                         Thread.sleep(100);
                     } catch (InterruptedException e) {
                         Log.e(ERROR, Thread Interrupted);
                     }
                     Message msg = mHandler.obtainMessage();
                     Bundle b = new Bundle();
                     b.putInt(total, mWebView.getProgress());
                     msg.setData(b);
                     mHandler.sendMessage(msg);
                 }
             }

             /* sets the current state for the thread,
              * used to stop the thread */
             public void setState(int state) {
                 mState = state;
             }
         }

 }

 Hopefully that helps you in your task.

 -Tope

 On Mon, Feb 1, 2010 at 1:05 PM, Achanta krishna.acha...@gmail.com wrote:
  I saw that tutorial earlier and have also tried it.

  Yes for now even a progress dialog in that way works for me.
  I know i need to use getProgress but do not know how to send the
  progress to the thread running the progress dialog.

  Thanks again.

  On Feb 1, 11:58 am, Temitope Akinwande takinwa...@gmail.com wrote:
  I found this tutorial

 http://www.helloandroid.com/tutorials/using-threads-and-progressdialog

  What you can try to do and see if it works is to create a new thread
  on button click so that when the page is loading, you can display an
  indeterminate progress dialog while you are waiting on the page to be
  done loading using Webview's getProgress() 
  methodhttp://developer.android.com/intl/fr/reference/android/webkit/WebView...()
  .

  Create a handler so that when

[android-developers] Nexus 1 Vendor id?

2010-02-02 Thread Achanta
Hello,

I am trying to test my app on Nexus 1 but do not have the Vendor Id
and could not find it.
Can anyone tell what the Vendor ID for nexus one is.

thank you.

-- 
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] kickoff maps after clicking on address from browser or webview

2010-02-02 Thread Achanta
I need to provide the users with an option to kick off the turn by
turn directions when they click on the address in my company's web
page.

I saw that the android devices already do this in some cases and I
would like to use this default feature provided by the OS. So please
let me know what is required for me as a developer do do either on my
app in the webview or on my server side code displaying the webpage in
order to let the device to kick off the maps app when user clicks on
the address.

It will also be nice to know if it is also possible to do the same
with phone numbers.

Thank you.

-- 
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] Split and join files

2010-02-01 Thread Achanta
I have a large database and my plan is to supply it along with the app
so that the users need not wait for around 15 min for the initial
download, xml processing and creating the database.

I want to put the database files in the assets folder and copy them
when the user uses the app for the first time. But since there is a
filesize restriction on the files in assets folder, I want to split
the database files and then put them in the assets folder. Now when
the user opens the app for the first time all i want to do is join
these files and copy them to the device.

I have searched around and saw that a couple of posts which mentioned
that it is possible but did not find anything that explains how to do
split the files and join them.

please let me know how I can do this.

Thank you.

-- 
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 a loading image or an animation?

2010-02-01 Thread Achanta
I have a search box and a web view in my activity.

I also have a search button which when someone clicks opens a the url
in the webview below the search box.

Everything is working fine except that it remains blank while the page
loads.
I want to show a loading message with a spinning icon/animation while
the page loads. [similar to one in the market app].

please let me know how to do it.
Thank you.

-- 
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 show a loading image or an animation?

2010-02-01 Thread Achanta
Thank you for the reply,

 as I'm sure this question has been asked before.
I was also sure that it has been asked before because its a common
task, But searching the web or this group did not give me the
appropriate results.

 From what I gather, you'll have to start a thread using AsyncTask and
 that way you can show your progress dialog.
I may have to but I am not sure. Here I am loading a webpage and this
is happening in the same thread or it appears to be. I can also get
the progress of it from the WebView. I am not doing any background
activity like calculations or downloading stuff, but loading the page
which is on the same thread. So I am a little lost on how to get this
done.

Thanks again.


On Feb 1, 11:12 am, Temitope Akinwande takinwa...@gmail.com wrote:
 Hi,

 You can check this 
 outhttp://developer.android.com/intl/fr/guide/topics/ui/dialogs.html#Pro...http://developer.android.com/intl/fr/reference/android/os/AsyncTask.html

 From what I gather, you'll have to start a thread using AsyncTask and
 that way you can show your progress dialog.
 A search of progress dialog and async task should yield more results
 as I'm sure this question has been asked before.

 -Tope

 On Mon, Feb 1, 2010 at 10:39 AM, Achanta krishna.acha...@gmail.com wrote:
  I have a search box and a web view in my activity.

  I also have a search button which when someone clicks opens a the url
  in the webview below the search box.

  Everything is working fine except that it remains blank while the page
  loads.
  I want to show a loading message with a spinning icon/animation while
  the page loads. [similar to one in the market app].

  please let me know how to do it.
  Thank you.

  --
  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 show a loading image or an animation?

2010-02-01 Thread Krishna Achanta
I saw that tutorial earliear and have also tried it.

Yes for now even a progress dialog in that way works for me.
I know i need to use getProgress but do not know how to send the progress to
the thread running the progress dialog.

Thanks again.

On Mon, Feb 1, 2010 at 11:58 AM, Temitope Akinwande takinwa...@gmail.comwrote:

 I found this tutorial

 http://www.helloandroid.com/tutorials/using-threads-and-progressdialog

 What you can try to do and see if it works is to create a new thread
 on button click so that when the page is loading, you can display an
 indeterminate progress dialog while you are waiting on the page to be
 done loading using Webview's getProgress() method

 http://developer.android.com/intl/fr/reference/android/webkit/WebView.html#getProgress()http://developer.android.com/intl/fr/reference/android/webkit/WebView.html#getProgress%28%29
 .

 Create a handler so that when the page is done loading, you can
 dismiss the dialog.
 Hope that helps you(see the tutorial).


 On Mon, Feb 1, 2010 at 11:41 AM, Achanta krishna.acha...@gmail.com
 wrote:
  Thank you for the reply,
 
  as I'm sure this question has been asked before.
  I was also sure that it has been asked before because its a common
  task, But searching the web or this group did not give me the
  appropriate results.
 
  From what I gather, you'll have to start a thread using AsyncTask and
  that way you can show your progress dialog.
  I may have to but I am not sure. Here I am loading a webpage and this
  is happening in the same thread or it appears to be. I can also get
  the progress of it from the WebView. I am not doing any background
  activity like calculations or downloading stuff, but loading the page
  which is on the same thread. So I am a little lost on how to get this
  done.
 
  Thanks again.
 
 
  On Feb 1, 11:12 am, Temitope Akinwande takinwa...@gmail.com wrote:
  Hi,
 
  You can check this outhttp://
 developer.android.com/intl/fr/guide/topics/ui/dialogs.html#Pro...http://developer.android.com/intl/fr/reference/android/os/AsyncTask.html
 
  From what I gather, you'll have to start a thread using AsyncTask and
  that way you can show your progress dialog.
  A search of progress dialog and async task should yield more results
  as I'm sure this question has been asked before.
 
  -Tope
 
  On Mon, Feb 1, 2010 at 10:39 AM, Achanta krishna.acha...@gmail.com
 wrote:
   I have a search box and a web view in my activity.
 
   I also have a search button which when someone clicks opens a the url
   in the webview below the search box.
 
   Everything is working fine except that it remains blank while the page
   loads.
   I want to show a loading message with a spinning icon/animation while
   the page loads. [similar to one in the market app].
 
   please let me know how to do it.
   Thank you.
 
   --
   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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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.comandroid-developers%2bunsubscr...@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] Re: How to show a loading image or an animation?

2010-02-01 Thread Achanta
I saw that tutorial earlier and have also tried it.

Yes for now even a progress dialog in that way works for me.
I know i need to use getProgress but do not know how to send the
progress to the thread running the progress dialog.

Thanks again.

On Feb 1, 11:58 am, Temitope Akinwande takinwa...@gmail.com wrote:
 I found this tutorial

 http://www.helloandroid.com/tutorials/using-threads-and-progressdialog

 What you can try to do and see if it works is to create a new thread
 on button click so that when the page is loading, you can display an
 indeterminate progress dialog while you are waiting on the page to be
 done loading using Webview's getProgress() 
 methodhttp://developer.android.com/intl/fr/reference/android/webkit/WebView...()
 .

 Create a handler so that when the page is done loading, you can
 dismiss the dialog.
 Hope that helps you(see the tutorial).

 On Mon, Feb 1, 2010 at 11:41 AM, Achanta krishna.acha...@gmail.com wrote:
  Thank you for the reply,

  as I'm sure this question has been asked before.
  I was also sure that it has been asked before because its a common
  task, But searching the web or this group did not give me the
  appropriate results.

  From what I gather, you'll have to start a thread using AsyncTask and
  that way you can show your progress dialog.
  I may have to but I am not sure. Here I am loading a webpage and this
  is happening in the same thread or it appears to be. I can also get
  the progress of it from the WebView. I am not doing any background
  activity like calculations or downloading stuff, but loading the page
  which is on the same thread. So I am a little lost on how to get this
  done.

  Thanks again.

  On Feb 1, 11:12 am, Temitope Akinwande takinwa...@gmail.com wrote:
  Hi,

  You can check this 
  outhttp://developer.android.com/intl/fr/guide/topics/ui/dialogs.html#Pro...

  From what I gather, you'll have to start a thread using AsyncTask and
  that way you can show your progress dialog.
  A search of progress dialog and async task should yield more results
  as I'm sure this question has been asked before.

  -Tope

  On Mon, Feb 1, 2010 at 10:39 AM, Achanta krishna.acha...@gmail.com wrote:
   I have a search box and a web view in my activity.

   I also have a search button which when someone clicks opens a the url
   in the webview below the search box.

   Everything is working fine except that it remains blank while the page
   loads.
   I want to show a loading message with a spinning icon/animation while
   the page loads. [similar to one in the market app].

   please let me know how to do it.
   Thank you.

   --
   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] Re: adding voice search

2010-01-22 Thread Achanta
Thank you Schwiz,
Thats what I needed

On Jan 21, 11:20 am, schwiz sch...@gmail.com wrote:
 I think you would override onActivityResult like I did in my project.

 On Jan 21, 12:17 pm, Achanta krishna.acha...@gmail.com wrote:

  Thank you Schwiz and David for the replies. they were helpful.

  I included the part that David advised and it works great.

  Now I have a requirement with the search in my project.
  I need to provide a widget like the quick Search box in the main page
  of the app..ie., it should always be visible. It should also have the
  voice search[mic] button.

  So when users start typing in this or click on the mic button and
  start speaking, it should grab the string and open the search results
  page with this search string.
  How can I implement that?

  Thanks again.

-- 
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 voice search

2010-01-22 Thread Achanta
Thank you Schwiz,
Thats what I needed

On Jan 21, 11:20 am, schwiz sch...@gmail.com wrote:
 I think you would override onActivityResult like I did in my project.

 On Jan 21, 12:17 pm, Achanta krishna.acha...@gmail.com wrote:

  Thank you Schwiz and David for the replies. they were helpful.

  I included the part that David advised and it works great.

  Now I have a requirement with the search in my project.
  I need to provide a widget like the quick Search box in the main page
  of the app..ie., it should always be visible. It should also have the
  voice search[mic] button.

  So when users start typing in this or click on the mic button and
  start speaking, it should grab the string and open the search results
  page with this search string.
  How can I implement that?

  Thanks again.

-- 
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 voice search

2010-01-21 Thread Achanta
Thank you Schwiz and David for the replies. they were helpful.

I included the part that David advised and it works great.

Now I have a requirement with the search in my project.
I need to provide a widget like the quick Search box in the main page
of the app..ie., it should always be visible. It should also have the
voice search[mic] button.

So when users start typing in this or click on the mic button and
start speaking, it should grab the string and open the search results
page with this search string.
How can I implement that?

Thanks again.
-- 
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 voice search

2010-01-19 Thread Achanta
Did you happen to figure this out?

Can someone point to the correct resource or example regarding voice
search.

Thank you.

On Dec 1 2009, 5:01 pm, schwiz sch...@gmail.com wrote:
 I have seen plenty of other apps do this can anyone at all please
 point me to the documentation for this!!

 On Dec 1, 2:22 pm, schwiz sch...@gmail.com wrote:

  bump

  On Dec 1, 12:53 am, schwiz sch...@gmail.com wrote:

   I want to add avoicesearchbutton to one of my apps but I can't seem
   to find documentation on it anywhere.  Can someone give me an example
   or point me to one?
   Thanks!
-- 
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 implement search within the app?

2010-01-19 Thread Achanta
How do we implement search within an application.

I need my application to handle the search menu button click and
handle the text to search data from my application's database.

I have looked at the SearchManager but could not figure out how to
handle the search to query my database. i could not find any related
examples either on the net.

Can someone point me to an example or related resources on how to do
this?

Thank you.
-- 
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 can we change the view within the tabs?

2009-12-13 Thread Achanta
I have attached a sample project at the link below which shows the
tabview with the problem that I am talking about. Please check it out
and let me know if you know where I am going wrong or what I need to
do.
http://www.anddev.org/how_can_we_change_the_view_of_the_tabs-t9527.html

Thank you.

On Dec 10, 5:22 pm, Achanta krishna.acha...@gmail.com wrote:
 I want to provide a clickthrough on the list in a tab which opens
 another view.
 I need to open the new view within the same tab. I then need to
 provide a back button on the changed layout to change the view to
 original view.

 I have tried this.
 I am trying to access the tabSpec from main activity class
 [MainTabView] and set the intent as follows.
 Java:
 MainTabView.tabSpec1.setContent(new Intent(this, AView.class));
 MainTabView.mTabHost.setCurrentTab(0);
 MainTabView.mTabHost.invalidate();

 But this does not change the view immediately but changes it when I go
 to another tab and come to the starting tab. How can I make it to
 refresh it as soon as the content has been changed to another intent?

 Please share your ideas on this. Alternative solutions/ideas are also
 welcome.

 Thank you

-- 
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 can we change the view within the tabs?

2009-12-10 Thread Achanta
I want to provide a clickthrough on the list in a tab which opens
another view.
I need to open the new view within the same tab. I then need to
provide a back button on the changed layout to change the view to
original view.

I have tried this.
I am trying to access the tabSpec from main activity class
[MainTabView] and set the intent as follows.
Java:
MainTabView.tabSpec1.setContent(new Intent(this, AView.class));
MainTabView.mTabHost.setCurrentTab(0);
MainTabView.mTabHost.invalidate();

But this does not change the view immediately but changes it when I go
to another tab and come to the starting tab. How can I make it to
refresh it as soon as the content has been changed to another intent?

Please share your ideas on this. Alternative solutions/ideas are also
welcome.

Thank you

-- 
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] Progress Dialog: how to pass context or adapter to the thread

2009-11-20 Thread Achanta
I am trying to display a progress bar while download data and store it
in my database.
My problem is that I need to pass the database adapter or the context
to the thread.

This is what I have tried.

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try{
adapter = dbInit();
button = (Button)findViewById(R.id.progressDialog);
button.setOnClickListener(new OnClickListener(){
  public void onClick(View v){
   showDialog(PROGRESS_DIALOG);
  }
});
}finally{
  adapter.close();
}
}

protected Dialog onCreateDialog(int id){
 switch(id){
 case PROGRESS_DIALOG:
  progressDialog = new ProgressDialog(ProgressBarSample.this);
  progressDialog.setMessage(loading message...);

  thread = new MyThread(handler);
  thread.start();

  return progressDialog;
 default:
  return null;
 }
}

private MyDbAdapter dbInit(){
 adapter = new MyDbAdapter(this);
 adapter.open();
 adapter.deleteMyTable();
 adapter.createMyTable();
 return adapter;
}

final Handler handler = new Handler(){
 public void handleMessage(Message msg){
  int status = msg.getData().getInt(status);
if (status = 0){
   progressDialog.setMessage(Downloading data part2...);
   dismissDialog(PROGRESS_DIALOG);
  }
 }

};

public class MyThread extends Thread{
 private Handler myHandler;
 int downloadStatus;
 final String dUrl = MY_XML_URL;

 public MyThread(Handler handler){
  this.myHandler = handler;
  downloadStatus = -1;
 }

 public void run(){
  Message msg = myHandler.obtainMessage();
  Bundle b = new Bundle();
  downloadStatus = downloadTables(dUrl);
   b.putInt(status, downloadStatus);
   msg.setData(b);
   myHandler.sendMessage(msg);
 }

public int downloadTables(String xmlUrl){
  int downloadStatus = 0;
  try{
   URL url = new URL(xmlUrl);
   SAXParserFactory factory = SAXParserFactory.newInstance
();
   SAXParser parser = factory.newSAXParser();
   XMLReader reader = parser.getXMLReader();
   MyHandler handler = new MyHandler(adapter);
   reader.setContentHandler(handler);
   reader.parse(new InputSource(url.openStream()));
  }catch(Exception e){
   Log.e(Error: ,  + e.getMessage());
   System.exit(0);
  }finally{
   downloadStatus = 1;
  }
  return downloadStatus;
}

}
}

but when I run this i get the following error.


I/ActivityManager(   57): Starting activity: Intent
{ act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] flg=0x1020
cmp=com.achie.test/.ProgressBarSample }
I/ActivityManager(   57): Start proc com.achie.test for activity
com.achie.test/.ProgressBarSample: pid=548 uid=10024 gids={3003}
D/ddm-heap(  548): Got feature list request
I/ActivityManager(   57): Displayed activity
com.achie.test/.ProgressBarSample: 1235 ms (total 1235 ms)
E/Error:  (  548): database not open
I/AndroidRuntime(  548): AndroidRuntime onExit calling exit(0)
I/WindowManager(   57): WIN DEATH: Window{43be4df0 com.achie.test/
com.achie.test.ProgressBarSample paused=false}
I/ActivityManager(   57): Process com.achie.test (pid 548) has died.
I/WindowManager(   57): WIN DEATH: Window{43c94128 Downloading Data
paused=false}
W/UsageStats(   57): Unexpected resume of com.android.launcher while
already resumed in com.achie.test
W/InputManagerService(   57): Got RemoteException sending setActive
(false) notification to pid 548 uid 10024

It looks like I cannot pass the adapter from the thread as I am doing
as its running as a separate thread and have to use handler to pass
it. Can anyone let me know how to do this.

thank you,

-- 
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