[android-developers] Re: Device Seeding Program for Top Android Market Developers

2010-04-17 Thread Amir Alagic
I really appreciate this and am thankful to Google but I think it
would be much better that they invested that money to improve Android
Market and to add paid apps support for more countries as they
promised in Q1 2009.

That would create more buzz and would give us all more great apps on
Android platform... Anyway, thank you Google.

-- 
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: Question about the Lsit View

2010-04-17 Thread SheikhAman
Google for Droiddraw first. it will give you a nice toll to draw all
ur layouts in android.

secondly, use an vertical linear layout, in it, add a text view, then
add a list view, then add a linear layout, inside linear layout, add
button1 and button2.
so the text view, list view and linear layout will appear vertically
stacked.
later in the second linear layout, add ur buttons.

hows this?

On Apr 16, 7:23 pm, desgraci care.n...@gmail.com wrote:
 Hi i'm new on this forum, i searched for a way to make divs in my
 android apps but i cant find any post of this theme, so i post what i
 want to do here:

 
 |        Text View |   not scrollbable
 
 |   List               |  Scrollbable
 
 | Button1Button2| not scrollbable
 -

 Also when i try to make a 1.6 android application, whit this code:

 HelloList.java

 package com.examples;

 import android.app.ListActivity;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.ListView;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.AdapterView.OnItemClickListener;

 public class HelloList extends ListActivity {
     private String[]
 COUNTRIES=getResources().getStringArray(R.array.countries_array);;

         /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         this.setListAdapter(new ArrayAdapterString(this,
 R.layout.list_item, COUNTRIES));
         ListView lv = getListView();
         lv.setTextFilterEnabled(true);

         lv.setOnItemClickListener(new OnItemClickListener() {
             public void onItemClick(AdapterView? parent, View view,
                     int position, long id) {
                   // When clicked, show a toast with the TextView text
                   Toast.makeText(getApplicationContext(), ((TextView)
 view).getText(),
                       Toast.LENGTH_SHORT).show();
                 }
               });

     }

 }

 res/values/valores.xml

 ?xml version=1.0 encoding=utf-8?
 resources
     string-array name=countries_array
         itemBahrain/item
         itemBangladesh/item
         itemBarbados/item
         itemBelarus/item
         itemBelgium/item
         itemBelize/item
         itemBenin/item
     /string-array
 /resources

 res/values/string.xml

 ?xml version=1.0 encoding=utf-8?
 resources
     string name=helloHello World, HelloList!/string
     string name=app_nameHola Lista/string
 /resources

 res/values/list_item.xml

 ?xml version=1.0 encoding=utf-8?
 TextView xmlns:android=http://schemas.android.com/apk/res/android;
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     android:padding=10dp
     android:textSize=16sp 
 /TextView

 res/values/main.xml

 ?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
     
 TextView
     android:layout_width=fill_parent
     android:layout_height=wrap_content
     android:text=@string/hello
     /
 /LinearLayout

 --
 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: Selling outside the Android Market-- Use Google Checkout to sell direct from website??? SlideMe.Org??

2010-04-17 Thread mot12
George,

By all means, be honest. Fact is that you have ignored my request for
a payout that I sent you March 12, 2010. That's a long time ago. The
same day I make a negative posting here about you, you send me an
email with a bogus explanation that I have not followed some formal
format. You never sent me an email detailing this mysterious format
but after a previous complaint you did promise to pay me out even
though my earnings were less than $100. I am still waiting for that to
happen.

So you can continue to shift blame or you can make good on your
promise. No matter what you do, I will report what happens here in
honesty.

Martin

-- 
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 1.5 marketshare is increasing

2010-04-17 Thread Anthoni
Hi, don't know if this is the case for everyone but I am on a 1.5
device. HTC Hero and currently waiting for the 2.1 release from HTC
that is being constantly delayed. 3 (in the UK) have been doing a push
for new HTC Hero contracts (probably to get rid of the backlog whilst
they stock the Desire), so this might also account for the sudden
increase.

Just my thoughts.

Regards
Anthoni

On Apr 17, 2:37 am, Petroleum Nasby pnasby1...@gmail.com wrote:
 The Android Device Dashboard

 4 January 2010:

 Android 1.1   0.3%
 Android 1.5   31.0%
 Android 1.6   47.6%
 Android 2.0   0.7%
 Android 2.0.1   20.4%

 12 April 2010:

 Android 1.1   0.1%
 Android 1.5   38.0%
 Android 1.6   31.6%
 Android 2.0   0.3%
 Android 2.0.1   2.7%
 Android 2.1   27.3%

 Thankfully, the pre-2.0 share is shrinking overall.

 But the share for 1.5 *grew* from 31% to 38%. That can't be good.

 P. V. Nasby

 --
 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] Listview with button on same activity

2010-04-17 Thread Er. syed imran ali
Hi all,
i tried a lot but i did not success,
my problem is i want to add first one button and below that one
listview.
for that i divided my xml in two Linearlayout as below in code but it
is not
working when i am hiding button code then list view is coming other
wise only
button is coming on the screen.
please find out my error in xml or any thing i have to do in .java
file

my xml code is.

?xml version=1.0 encoding=UTF-8?

LinearLayout
 xmlns:android=http://schemas.android.com/apk/res/android;
android:orientation=horizontal
android:layout_width=fill_parent
android:layout_height=fill_parent
style=@style/MainBody


   AbsoluteLayout
android:layout_width=fill_parent
android:layout_height=80px
android:gravity=top
android:padding=10px


 TextView android:layout_width=fill_parent
android:layout_height=wrap_content
android:textColor=#00
android:textSize=20sp
android:layout_x=15px
android:layout_y=10px
 android:textStyle=bold
 android:text=Inspection  /

 ImageButton android:id=@+id/button_add
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_x=175px
 android:layout_y=1px
 android:background=@drawable/add_plus
 /ImageButton



/AbsoluteLayout

 LinearLayout
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=wrap_content
 android:layout_x=10px
 android:layout_y=90px
android:padding=10px
android:gravity=bottom
android:background=@drawable/myhelper_border



ListView android:id=@+id/listview_insp
android:layout_width=fill_parent
android:layout_height=fill_parent
android:layout_x=10px
 android:layout_y=190px
  android:background=@drawable/myhelper_border
 /
/LinearLayout


 /LinearLayout



Thanks and regards
Syed Imran Ali

-- 
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] Android Preferences

2010-04-17 Thread ~ TreKing
On Fri, Apr 16, 2010 at 12:14 AM, Abhinav abhinav.abhic...@gmail.comwrote:

 What is the difference between Preference.OnPreferenceChangeListener and
 Preference.OnPreferenceClickListener?


Going to go out on a limb and take a massive stab in the dark ... but ...
maybe, on tells you when a preference was CHANGED and one tells you a
preference was CLICKED.
Just a guess though. I guess I could take a look at the documentation to
find out for sure, since it's right there in the description for each ...
but that would be too easy.

http://developer.android.com/intl/de/reference/android/preference/Preference.OnPreferenceChangeListener.html

http://developer.android.com/intl/de/reference/android/preference/Preference.OnPreferenceChangeListener.html
http://developer.android.com/intl/de/reference/android/preference/Preference.OnPreferenceClickListener.html

-
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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Looped ListView

2010-04-17 Thread ~ TreKing
On Fri, Apr 16, 2010 at 7:29 AM, Pal pavel.khlusti...@gmail.com wrote:

 Please, advice if you have any ideas


Here's one idea. Implement a custom adapter and have the getCount() (or
whatever) function return 1,000,000 or something equally ridiculous.
Then implement getView() to do a mod operation on the actual number of items
in the list.
So if the list view was trying to show item at index 14 or 984, you would
return the actual item at index 4 (14 % 10, 984 % 10), etc.
You would probably have to add or subtract 1 somewhere to account for
0-based indexing.
Also, this would only work scrolling down the list - scrolling back up to 0
would stop the list from wrapping around. I think you'd probably have to
extend or replace ListView completely to do that.

Hope that helps some.

-
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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Prevent Orientation change at runtime

2010-04-17 Thread ~ TreKing
2010/4/15 jongnam!~ dndmani...@gmail.com

 after your answer read i tried it but SuperNotCalled Exception is issued

 can i resolve this Exception?


If the system is telling you it's throwing an exception because super was
not called, why don't you try calling
super.whateverFunctionYouAreOverriding() in
whateverFunctionYouAreOverriding() ?

-
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.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: install .apk file OTA

2010-04-17 Thread patbenatar
Put it up on a webserver then go to http://www.yourserver.com/yourpackage.apk
and the file will be downloaded to your phone--delivering the apk
OTA.. The Browser will recognize it as an apk file and if the user
has Allow Non-Market Apps enabled, the user will be prompted for an
install.

I've never done this but from reading other topics on this group, this
is my understanding.



On Apr 15, 9:49 pm, Rishabh rishabhjainw...@gmail.com wrote:
 Hi,

 I have an android's .apk signed file , how can I install it OTA on my
 Android 2.1 device.

 Thanks
 Rishabh

 --
 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: What's wrong with this location code?

2010-04-17 Thread patbenatar
I have solved this problem [with much thanks to the brains on this
group] by running two LocationListeners side-by-side, one fine [GPS]
and one coarse [Network]. The first provider to get a location update
wins and I use that location. This works for me as I don't care about
the location being super accurate at this point [later in my app I
allow the listeners to run their lives and whenever GPS is active and
available I use its updates then if it goes unavailable/disabled I
allow Network to take over [the whole while I'm running the two
listeners side-by-side, and just not handling updates from Network if
GPS is active/available].

You really have no reason to have a LocationListener[10] array...
There are really only two location providers, Network and GPS. So all
you need are two LocationListeners: fineLocationListener and
coarseLocationListener.

Here, this is the thread in which I learned how to do this:
http://groups.google.com/group/android-developers/browse_thread/thread/99ebef7294b094d5/6945dab119f1bf67
.. its a pretty good discussion on LocationListeners.

Hope this helps!

-Nick


On Apr 16, 6:06 pm, JP joachim.pfeif...@gmail.com wrote:
 What I do.
 I never even look at lastKnownLocation; as you state it might be old
 like dustballs.
 This means I will only process locations received fresh from
 onLocationChanged().
 As you note, this may never happen. So keep users informed
 accordingly! If you couldn't acquire a fix, let the user know.

 On Apr 16, 3:41 pm, Anna PS annapowellsm...@googlemail.com wrote:





   On Apr 16, 12:45 am, JP joachim.pfeif...@gmail.com wrote:
   On Apr 15, 8:35 am, Anna PS annapowellsm...@googlemail.com wrote:

Yet in my log files, I can
still see the Android NetworkLocationProvider logging
onCellLocationChanged events. Is this a bug in my code?

   Without diving into your code. Double check it by using GPS. GPS is
   considerably more accurate than base station based triangulation,
   which may not result in location changes even if you move a hundred
   meters (in my experience, anyway).

  The basic issue is this. I don't want to accidentally end up with a
  LastKnownLocation that's days out of date, so I have to check the age
  of the location fix.

  Since the GPS time (from location.getTime()) and the system time can
  be quite different (as a href=http://www.mail-archive.com/android-
  develop...@googlegroups.com/msg47517.htmldiscussed here/a,
  comparing the two doesn't work. The only reliable way seems to be:

  - get an initial location from getLastKnownLocation
  - wait for a location update from onLocationChanged
  - compare the age of the two to make sure the latter is newer.

  However, I'd also like to write code that handles gracefully the
  possibility that the user is (say) indoors, and therefore won't get an
  onLocationChanged event at all. (In which case, we should just take
  the LastKnownLocation, and never mind if it's out of date.)

  I seem to be at a logical impasse. What can I do? I can't wait for an
  onLocationChanged event if it's never going to happen - my code will
  hang forever! But equally I can't just take getLastKnownLocation every
  time - it might be wildly inaccurate.

  Maybe I need to run some kind of timer in the code, to check how long
  we've been waiting for an onLocationChanged. Does that seem like the
  best idea?

  --
  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 
 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: install .apk file OTA

2010-04-17 Thread Rishabh
Thanks patbenatar,

I am trying it like this.

On Apr 17, 11:31 am, patbenatar patbena...@gmail.com wrote:
 Put it up on a webserver then go tohttp://www.yourserver.com/yourpackage.apk
 and the file will be downloaded to your phone--delivering the apk
 OTA.. The Browser will recognize it as an apk file and if the user
 has Allow Non-Market Apps enabled, the user will be prompted for an
 install.

 I've never done this but from reading other topics on this group, this
 is my understanding.

 On Apr 15, 9:49 pm, Rishabh rishabhjainw...@gmail.com wrote:

  Hi,

  I have an android's .apk signed file , how can I install it OTA on my
  Android 2.1 device.

  Thanks
  Rishabh

  --
  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 
 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: Avoid restarting http request on orientation change

2010-04-17 Thread Bob Kerns
You are 100% on the right track; this calls for a service.

As for what happens when your activity is no longer running -- well,
let's consider that.

First, if your activity is simply no longer the current activity --
the user may have pressed Home, for example -- he may switch back to
it. You'd like to have actually made some progress in the meantime --
especially if he left because he was tired of waiting for the
transfer. You probably want to let the transfer continue until
onDestroy() is called on your Activity, at which point you can stop
the service.

If your activity is truly gone -- well, would that information be
useful if he started up your program again later? If so, you might
want to consider allowing the transfer to finish, and caching the
result. In this model, the activity's onDestroy() method leaves the
service alone, and the service calls stopSelf() when it's done. Next
time it's started for this purpose, it can check for the cached data
and immediately supply that.

If caching is inappropriate, and you want it to only run when the
Activity is still alive, then use bindServce() instead of
startService(), and  unbind the service in the Activity's onDestroy().
The Service can track how many bindings are active, and exit early out
of its loop reading the data. You couldn't do any better than this at
stopping the activity even if you were doing it in the Activity
anyway.


On Apr 16, 9:57 pm, patbenatar patbena...@gmail.com wrote:
 Hey all-

 I've run into an interesting little issue.. My loader Activity fetches
 data from a web API, starting an http request and waiting for the
 result.. Now what if the user flips their phone mid-http request? The
 Activity is destroyed and restarted, thus the http request restarts as
 well. The fact that my Activity is being destroyed on orientation
 change is all good by me, I understand the way Android works, I'm just
 looking for a solution to avoid restarting the http request on every
 orientation change..

 I'm thinking the solution would be Services... I could run a Service
 in the background to do the http request and when it finishes, call
 back to my Activity and let it handle the data and finish up. The one
 thing I'm a bit weirded out about is what if the user closes my app
 before the Service's http request finishes? What will it do with the
 data if the Activity that needs it is no longer running?

 Thoughts, feedback, ideas, etc would be great!

 Thanks,
 Nick

 --
 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: Question about the Lsit View

2010-04-17 Thread patbenatar
No divs. If you want to use HTML/CSS markup, look into WebView.

For building a native Android UI, check out these links:
http://developer.android.com/guide/topics/ui/index.html
http://developer.android.com/guide/topics/ui/layout-objects.html

That DroidDraw tip given by SheikhAman is a great resource as well if
you don't want to build your layout manually with XML.

-Nick


On Apr 16, 11:13 pm, SheikhAman shekh.a...@gmail.com wrote:
 Google for Droiddraw first. it will give you a nice toll to draw all
 ur layouts in android.

 secondly, use an vertical linear layout, in it, add a text view, then
 add a list view, then add a linear layout, inside linear layout, add
 button1 and button2.
 so the text view, list view and linear layout will appear vertically
 stacked.
 later in the second linear layout, add ur buttons.

 hows this?

 On Apr 16, 7:23 pm, desgraci care.n...@gmail.com wrote:





  Hi i'm new on this forum, i searched for a way to make divs in my
  android apps but i cant find any post of this theme, so i post what i
  want to do here:

  
  |        Text View |   not scrollbable
  
  |   List               |  Scrollbable
  
  | Button1Button2| not scrollbable
  -

  Also when i try to make a 1.6 android application, whit this code:

  HelloList.java

  package com.examples;

  import android.app.ListActivity;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.AdapterView;
  import android.widget.ArrayAdapter;
  import android.widget.ListView;
  import android.widget.TextView;
  import android.widget.Toast;
  import android.widget.AdapterView.OnItemClickListener;

  public class HelloList extends ListActivity {
      private String[]
  COUNTRIES=getResources().getStringArray(R.array.countries_array);;

          /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          this.setListAdapter(new ArrayAdapterString(this,
  R.layout.list_item, COUNTRIES));
          ListView lv = getListView();
          lv.setTextFilterEnabled(true);

          lv.setOnItemClickListener(new OnItemClickListener() {
              public void onItemClick(AdapterView? parent, View view,
                      int position, long id) {
                    // When clicked, show a toast with the TextView text
                    Toast.makeText(getApplicationContext(), ((TextView)
  view).getText(),
                        Toast.LENGTH_SHORT).show();
                  }
                });

      }

  }

  res/values/valores.xml

  ?xml version=1.0 encoding=utf-8?
  resources
      string-array name=countries_array
          itemBahrain/item
          itemBangladesh/item
          itemBarbados/item
          itemBelarus/item
          itemBelgium/item
          itemBelize/item
          itemBenin/item
      /string-array
  /resources

  res/values/string.xml

  ?xml version=1.0 encoding=utf-8?
  resources
      string name=helloHello World, HelloList!/string
      string name=app_nameHola Lista/string
  /resources

  res/values/list_item.xml

  ?xml version=1.0 encoding=utf-8?
  TextView xmlns:android=http://schemas.android.com/apk/res/android;
      android:layout_width=fill_parent
      android:layout_height=fill_parent
      android:padding=10dp
      android:textSize=16sp 
  /TextView

  res/values/main.xml

  ?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
      
  TextView
      android:layout_width=fill_parent
      android:layout_height=wrap_content
      android:text=@string/hello
      /
  /LinearLayout

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

[android-developers] Re: Flinge and LongPress Drag

2010-04-17 Thread patbenatar
Look into overriding OnTouchEvent, this gives you MUCH more
information on what type of touch event it was.

-Nick



On Apr 16, 7:19 am, androidFan kunigalg...@gmail.com wrote:
 Hi Guys,

  I am stuck with one requirement, i am involved in developing a
 display
  application.

   I need to switch between activities on a fling

   When the user presses Long Press and then drags, i should be
   able to move my view, i.e. the image itself.

  Currently i am planning to override the OnTouch Callback
  But LongPress is only given by a gesture.

  Can anyone let me know how to get this done?

 --
 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: What's wrong with this location code?

2010-04-17 Thread patbenatar
Oh, also... If a GPS fix is all you will accept, firstly your app will
not work in big buildings, under tunnels, dense metro areas [San
Francisco, NYC, etc] or anywhere like that where 3 GPS satellites are
not accessible. Secondly, if you can't get a fix after some sort of
realistic timeout, you'll need to notify the user of this so they're
not waiting around while your app repeatedly fails to get a GPS fix.

To expand on my above post, I would definitely recommend using both
listeners side-by-side but just always giving precedence to GPS
updates. This fixes many problems: 1) You'll pretty much always be
able to get some sort of fix. 2) In cities where GPS may unavailable,
there are likely lots of cell towers so cell triangulation will be
quite accurate [In Los Angeles, I've seen a Network fix be merely tens
of meters off from a GPS fix]. 3) In rural areas where cell towers are
few and far between, GPS is likely accessible [not many tall
buildings] so you'll be able to use that accurate fix.

-Nick



On Apr 16, 11:38 pm, patbenatar patbena...@gmail.com wrote:
 I have solved this problem [with much thanks to the brains on this
 group] by running two LocationListeners side-by-side, one fine [GPS]
 and one coarse [Network]. The first provider to get a location update
 wins and I use that location. This works for me as I don't care about
 the location being super accurate at this point [later in my app I
 allow the listeners to run their lives and whenever GPS is active and
 available I use its updates then if it goes unavailable/disabled I
 allow Network to take over [the whole while I'm running the two
 listeners side-by-side, and just not handling updates from Network if
 GPS is active/available].

 You really have no reason to have a LocationListener[10] array...
 There are really only two location providers, Network and GPS. So all
 you need are two LocationListeners: fineLocationListener and
 coarseLocationListener.

 Here, this is the thread in which I learned how to do 
 this:http://groups.google.com/group/android-developers/browse_thread/threa...
 .. its a pretty good discussion on LocationListeners.

 Hope this helps!

 -Nick

 On Apr 16, 6:06 pm, JP joachim.pfeif...@gmail.com wrote:





  What I do.
  I never even look at lastKnownLocation; as you state it might be old
  like dustballs.
  This means I will only process locations received fresh from
  onLocationChanged().
  As you note, this may never happen. So keep users informed
  accordingly! If you couldn't acquire a fix, let the user know.

  On Apr 16, 3:41 pm, Anna PS annapowellsm...@googlemail.com wrote:

On Apr 16, 12:45 am, JP joachim.pfeif...@gmail.com wrote:
On Apr 15, 8:35 am, Anna PS annapowellsm...@googlemail.com wrote:

 Yet in my log files, I can
 still see the Android NetworkLocationProvider logging
 onCellLocationChanged events. Is this a bug in my code?

Without diving into your code. Double check it by using GPS. GPS is
considerably more accurate than base station based triangulation,
which may not result in location changes even if you move a hundred
meters (in my experience, anyway).

   The basic issue is this. I don't want to accidentally end up with a
   LastKnownLocation that's days out of date, so I have to check the age
   of the location fix.

   Since the GPS time (from location.getTime()) and the system time can
   be quite different (as a href=http://www.mail-archive.com/android-
   develop...@googlegroups.com/msg47517.htmldiscussed here/a,
   comparing the two doesn't work. The only reliable way seems to be:

   - get an initial location from getLastKnownLocation
   - wait for a location update from onLocationChanged
   - compare the age of the two to make sure the latter is newer.

   However, I'd also like to write code that handles gracefully the
   possibility that the user is (say) indoors, and therefore won't get an
   onLocationChanged event at all. (In which case, we should just take
   the LastKnownLocation, and never mind if it's out of date.)

   I seem to be at a logical impasse. What can I do? I can't wait for an
   onLocationChanged event if it's never going to happen - my code will
   hang forever! But equally I can't just take getLastKnownLocation every
   time - it might be wildly inaccurate.

   Maybe I need to run some kind of timer in the code, to check how long
   we've been waiting for an onLocationChanged. Does that seem like the
   best idea?

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

[android-developers] HTC Desire keyboard problem

2010-04-17 Thread Michael Rueger

Hi all,

a day away from deployment...
Our application which we had tested on a G1 with 1.6 and a Nexus with 
2.1 suddenly has unexpected problems on a HTC desire (German version) 
with 2.1.


It seems that the keyboard behaves differently:

- event.getAction() == KeyEvent.ACTION_UP
doesn't work/fire

- android:imeOptions=actionNext
doesn't seem to be honored by the keyboard (it keeps the return button)

Unfortunately I don't have access to the phone (a user did some testing) 
so I can't debug.


Any ideas?

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


[android-developers] Re: Device Seeding Program for Top Android Market Developers

2010-04-17 Thread Lorents
Damn Icelandic people... First they mess with the world economy, and
now they spew ash around europe!

(just kidding)

-- 
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: Plz need Help

2010-04-17 Thread patbenatar
Please come up with a more descriptive title next time.
-Nick



On Apr 16, 1:55 am, Shoby Sunny shoby.andr...@gmail.com wrote:
 let X and Y be the 2 activities, and X wants to send some txt to Y...

 the snippet of X should be like this:

 Code:

 private void sendTxt()
 {
 Intent intent = new Intent();//intent is like the envelop
 intent.setClass(X.this, Y.class);//arg1 is the current class and arg2
 is the class u wanna call
 Bundle bundle = new Bundle(); //bundle is like the letter
 bundle.putString (keyword, hello) //arg1 is the keyword of the
 txt, arg2 is the txt
 intent.putExtras(bundle);//actually it's bundle who carries the
 content u wanna pass
 startActivity(intent);

 }

 accordingly, Y is:

 Code:
 private void getTxt()
 {
 if (Y.this.getIntent().getExtras() != null)
 {
 Bundle bundle = this.getIntent().getExtras();//get the intent  bundle
 passed by X
 Toast.makeText(Y.this,bundle.getString(keyword),Toast.LENGTH_SHORT).show( 
 );/*show
 the txt in a Toast, and of course u can show it anywhere else u want
 by calling Bundle.getString (String key) */





 }
 }
 On Thu, Apr 15, 2010 at 11:18 AM, Ali Murtaza mralimurt...@gmail.com wrote:

  Hi

  I am new in android and just want to save a data in one activity and then 
  send it on other activity, just like notepad tutorials i used

  Intent ii =

  new Intent(Calendar.this, EditEvent.class);

  ii.putExtra(

  eventdate, this.toString());

  and then in other activity

  date

  = savedInstanceState != null ? 
  savedInstanceState.getString(eventdate):null;

  i used this but it is not working, the date contain null

  please tell me error as well as the function which is run by default when 
  activity context switching occurs.

  Thanks

  --
  Ali Murtaza

  BCSF06M021
  Research Assistant
  Data Virtulization Ware House
  PUCIT, Lahore, Pakistan
  ali.murt...@pucit.edu.pk

  --
  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 
 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: Highlight part of the text in a textview object

2010-04-17 Thread patbenatar
Here is the more difficult, lower-level way to do this (probably also
has more functionality): 
http://developer.android.com/reference/android/text/Spannable.html

Here is the much easier way to do this: 
http://developer.android.com/reference/android/text/Html.html
... This one is REALLY nice. You can do things like
Html.fromHtml(Whatever I want bbold/b); .. This allows you to
use basic HTML markup to format your text. I'm not sure how many or
which HTML tags are supported.

-Nick




On Apr 16, 9:04 am, sebastian23 sebastia...@gmail.com wrote:
 Hi toghether

 i habe some text displayed in a textview and would like to highlight (e.g. a
 specific background or font color) part of it. But how can i do that? didn't
 found a solution in the api or google.

 thanks for any hint

 --
 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: Location listener called multiple times

2010-04-17 Thread patbenatar
Are you calling removeUpdates(yourLocationListener) on your
LocationManager in each Activity's onPause()? You must do this or else
you will end up with LocationListeners that never end and even after
your app's runtime is over your listeners will eat the user's battery
life.

http://developer.android.com/reference/android/location/LocationManager.html#removeUpdates(android.location.LocationListener)

Hope this helps,
Nick


On Apr 15, 11:23 pm, sujit panda sujit.andr...@gmail.com wrote:
 Hi,
 I am working on an Location Based Application. In this application i
 am using LocationListener class to update the location when the
 Location is changed.In each Activity i have different
 LocationListener  to update location and do some specific work on
 updated location. But my problem is that when i am changing my
 location through DDMS , the LocationListener is being called of that
 current Activity as well as all the activities of the whole
 application where LocationListener has been defined. I don't know
 whether there should be one LocationListener for the whole application
 or for each Activity we should have different LocationListener.

 Please help me..Its urgent..Thanks in Advance.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 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: Flinge and LongPress Drag

2010-04-17 Thread patbenatar
Also I just came across this thread that is similar:
http://groups.google.com/group/android-developers/browse_thread/thread/e5ffa5a6e999155f



On Apr 17, 12:15 am, patbenatar patbena...@gmail.com wrote:
 Look into overriding OnTouchEvent, this gives you MUCH more
 information on what type of touch event it was.

 -Nick

 On Apr 16, 7:19 am, androidFan kunigalg...@gmail.com wrote:





  Hi Guys,

   I am stuck with one requirement, i am involved in developing a
  display
   application.

    I need to switch between activities on a fling

    When the user presses Long Press and then drags, i should be
    able to move my view, i.e. the image itself.

   Currently i am planning to override the OnTouch Callback
   But LongPress is only given by a gesture.

   Can anyone let me know how to get this done?

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


Re: [android-developers] moveTaskToBack returning false.

2010-04-17 Thread Paul Townsend
Hi I found this maybe this will help

http://osdir.com/ml/Android-Developers/2010-03/msg01903.html

On 16 Apr 2010 22:02, ~ TreKing treking...@gmail.com wrote:

On Fri, Apr 16, 2010 at 3:53 PM, Prajakta Shitole prajakt...@gmail.com
wrote:


 no i dint because the documentation says that for any activity other than
main activity u need t...

Oh yeah, I read that wrong ... oh well, there goes that ... good luck.



-
...

-- 
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] Problems with big buttons using android:duplicateParentState

2010-04-17 Thread Marco Alexander Schmitz
Hi you all,

today I've got a silly little problem and I hope you can help me out.

I want to create a big button that contains a bitmap and some text.

So I created a container (LinearLayout) with clickable=true.

Inside this container there is an ImageButton with
duplicateParentState=true and a TextView.

The problem is that I can click everywhere in this container except on
the ImageButton.


In order to show that something is clicked I use an xml (with selector
and items) as background for the ImageView.


If you remove the clickable=true and duplicateParentState=true
only the the ImageButton is clickable.

How can I create such a big button as I want to?


Here comes some code:

First of all the button_green.xml with 2 different bitmaps:

?xml version=1.0 encoding=utf-8?
selector xmlns:android=http://schemas.android.com/apk/res/android;

item android:state_focused=false android:state_pressed=false
android:drawable=@drawable/button_green_normal /

item android:state_focused=true  android:state_pressed=false
android:drawable=@drawable/button_green_normal /

item android:state_focused=false android:state_pressed=true
android:drawable=@drawable/button_green_hover /

item android:state_focused=true android:state_pressed=true
android:drawable=@drawable/button_green_hover /

/selector

And then the main.xml with a top image and two big buttons:

?xml version=1.0 encoding=utf-8?
RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
 android:layout_width=fill_parent
android:layout_height=fill_parent
 android:background=#141414

 ImageView android:id=@+id/top
android:layout_width=wrap_content
  android:layout_height=wrap_content android:src=@drawable/
top
  android:layout_alignParentTop=true /

 !-- important here: android:clickable=true --
 LinearLayout android:id=@+id/bigbutton_1
  android:layout_below=@+id/top
android:layout_width=250dip
  android:layout_height=100dip android:background=@drawable/
bigbutton
  android:layout_centerHorizontal=true
android:layout_marginTop=25dip
  android:clickable=true

  !-- important here: android:duplicateParentState=true --
  ImageButton android:id=@+id/green_button
   android:layout_width=wrap_content
android:layout_height=wrap_content
   android:background=@drawable/button_green
android:layout_gravity=center_vertical
   android:duplicateParentState=true /

  TextView android:layout_width=wrap_content
   android:layout_height=wrap_content android:text=You
can click me !
   android:layout_gravity=center_vertical
android:textColor=#BBB5A5
   android:textSize=18dip /
 /LinearLayout

 !-- important here: android:clickable=true --
 LinearLayout android:id=@+id/bigbutton_2
  android:layout_below=@+id/bigbutton_1
android:layout_width=250dip
  android:layout_height=100dip android:background=@drawable/
bigbutton
  android:layout_centerHorizontal=true
android:layout_marginTop=25dip
  android:clickable=true

  !-- important here: android:duplicateParentState=true --
  ImageButton android:id=@+id/green_button
   android:layout_width=wrap_content
android:layout_height=wrap_content
   android:background=@drawable/button_red
android:layout_gravity=center_vertical
   android:textColor=#BBB5A5 android:textSize=18dip
   android:duplicateParentState=true /

  TextView android:layout_width=wrap_content
   android:layout_height=wrap_content
android:text=Click me, too !
   android:layout_gravity=center_vertical
android:textColor=#BBB5A5
   android:textSize=18dip /
 /LinearLayout

/RelativeLayout

Thanks for your help.

I'll attach the project so you can play around...

Greetings,
Marco

Screenshot: http://www.anddev.org/files/screenshot_652.png
Project: http://www.anddev.org/download.php?id=2058

-- 
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: NDK / glsl / Es 2.0 advice please?

2010-04-17 Thread Mario Zechner
Hi,

OpenGL ES 2.0 (GLES2) is completely based on writting your own vertex
and fragment shaders. Both types serve a specific purpose.

Vertex shaders in their most basic form are responsible for
transforming the incoming vertex position. This includes moving them
from object to world space, from world space to camera or view space
and finally projecting the camera/view space positions.
Transformations and projections are achieved via matrices which you
usually pass to your shader as so called uniforms. A vertex shader
outputs the final vertex position and potentially other information
for the fragment shader, like interpolated texture coordinates and
normals. A vertex shader thus has to perform the equivalent of the
fixed function pipeline transformation and lighting stage (with the
later often being implemented in the fragment shader instead to get
per pixel lighting).

A fragment shader is responsible for outputting a fragments color
based on various conditions. You might want to fetch a texel from a
texture as the color, apply phong shading based on interpolated
normals you receive from the vertex shader and so on.

As you can see there's various types of parameters and arguments
involved when programming shaders. In GLES2 there's 3 main types
(there are other less frequently used types as well): attributes,
uniforms and varyings. Attributes and uniforms are specified by you
via calls to glVertexAttrib, glVertexAttribPointer or glUniform.
Attributes represent vertex attributes like position, texture
coordintates, per vertex colors or normals. Uniforms are normally used
to pass in things like transformation and projection matrices that you
calculate outside the shaders in your program. Varyings are generated
within the vertex shader and passed to the fragment shader. Popular
examples would be interpolated texture coordinates or normals for
phong shading.

So what does all this mean for your scenario? First, you will need to
calculate the proper transformation and projection matrices yourself,
keep track of them yourself and pass them in as uniforms to your
vertex shader which then uses them to transform and project your
vertices.

There is no Android specific GLES2 reference as GLES2 is a standard
developed by Khronos which keep the API the same for all platforms.
The only difference between platforms is how to setup the GLES2
context and buffers. Usually this is done via EGL, another standard by
Khronos. On Android you can use the GLSurfaceView from the hello-gl2
example for that purpose and not worry about it.

To get information on the compilation process you can use the
functions glGetShaderInfoLog (http://www.opengl.org/sdk/docs/man/xhtml/
glGetShaderInfoLog.xml) and glGetProgramInfoLog (http://www.opengl.org/
sdk/docs/man/xhtml/glGetProgramInfoLog.xml). You usually use the first
one after you compiled a vertex or fragment shader and the second one
after you linked together a vertex/fragment shader pair to a program.
This will give you any errors or warnings the compiler produces. Note
that the output is not standardized and will differ for different GPUs
and their drivers.

My advice would be to get the OpenGL ES 2.0 Programming Guide, a nice
little book by the writers of the GLES2 standard which will guide you
through all the features and standard procedures of GLES2. The basic
concepts of GLES1 are still there in GLES2, however, you have a
greater flexibility by providing your own implementation for various
stages of the fixed function pipeline, including for example the
transform and lighting stage.

hth,
Mario


On 16 Apr., 06:20, HaMMeReD adamhamm...@gmail.com wrote:
 Working with NDK here.

 How are perspective correct projection supposed to occur in es 2.0. I
 can currently draw my geometry to the screen, but it is not getting
 transformed to 2d.

 Is there some sort of way of getting meaningful compiler errors out of
 the shader compiler?

 Is there a android specific reference to glsl support on it?

 Am I even supposed to be doing projections in my glsl?

 I was using hello-gl2 as a baseline, and then modified it to load
 additional geometry, which is rendering correctly although flat,
 without any translation or projection. Any advice on translation/
 projection is appreciated too, since it seems that all of that has
 disappeared from es2.0.

 I've got a opengl 1.1 live screensaver that I've developed that I want
 to work on porting critical sections to NDK and es2.0, so any advice
 on porting gl11 to gl20 is appreciated.

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

[android-developers] Re: glTexImage2D very slow on phones like Nexus one

2010-04-17 Thread Eong
Robert,
   Sorry, it's not text, it's tex. I just use this to draw the
background.
   I just want to know why nexus one is so slow with this. It takes
20ms on my milestone but it takes at least 80ms on the nexus one, for
one frame.

On 4月17日, 上午2时08分, Robert Green rbgrn@gmail.com wrote:
 Eong,

 You said you are uploading every frame just to draw text?  There are
 much more efficient ways to do that.

 On Apr 16, 11:14 am, Eong eong.c...@gmail.com wrote:



  I'm afraid it's not a same problem.
  My problem only happenes on Snapdragon phones.
  It's fine on Milestone or Droid. I found a few threads about this but
  no solution.

  On 4月16日, 下午9时15分, Felipe Silveira webfel...@gmail.com wrote:

   Just a guess: It can be the same error reported 
   here:http://code.google.com/p/android/issues/detail?id=7520

   Take a look...

   Felipe Silveirahttp://www.felipesilveira.com.br

   On Fri, Apr 16, 2010 at 8:40 AM, Eong eong.c...@gmail.com wrote:
Hi,
We are developing 2D games. And we found our game works fine except
the snapdragon chips, like Nexus one and Liquid A1. It even runs fine
on G1.

We use GLSurfaceView, and we useglTexImage2Dand glTexIsubmage2D to
put on the text and then draw.
TheglTexImage2Dclass take more than 100ms on Nexus one (1024x512 pix
tex). It's very strange, G1 is even faster than this.
If anyone know something about this?

-Code
snip---
                                       
gl.glClear(GL10.GL_COLOR_BUFFER_BIT
| GL10.GL_DEPTH_BUFFER_BIT);

 gl.glTexSubImage2D(GL10.GL_TEXTURE_2D, 0, 0, 0, m_width,
m_height, GL10.GL_RGB, GL_UNSIGNED_SHORT_5_6_5, m_byteCanvas);

                                       ((GL11Ext)gl).glDrawTexiOES(0, 
0, 0,
m_width, m_height);

--
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%2Bunsubs
 cr...@googlegroups.com
For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en

   --
   Felipe Silveira
   Engenharia da Computação
   Universidade Federal de Itajubáhttp://www.felipesilveira.com.br
   MSN: felipeuni...@hotmail.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 
   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 
  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 
 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: glTexImage2D very slow on phones like Nexus one

2010-04-17 Thread Mario Zechner
It seems that the msm chips are notorious for having a low bandwidth.
There's really no solution to that problem other than

1) lowering your texture size
2) lowering the bit depth of the texture, e.g. instead of using
RGBA use RGBA444 or RGB565
2) uploading your texture in patches, e.g. split it up into 4 smaller
parts and upload one part each frame. This will probably lead to
artifacts if your frame rate is low but could work otherwise.

Just out of curiousity: why do you have to upload such a big texture
each frame? If you'd state your scenario in detail we might be able to
suggest other solutions to the problem.

On 17 Apr., 12:10, Eong eong.c...@gmail.com wrote:
 Robert,
    Sorry, it's not text, it's tex. I just use this to draw the
 background.
    I just want to know why nexus one is so slow with this. It takes
 20ms on my milestone but it takes at least 80ms on the nexus one, for
 one frame.

 On 4月17日, 上午2时08分, Robert Green rbgrn@gmail.com wrote:



  Eong,

  You said you are uploading every frame just to draw text?  There are
  much more efficient ways to do that.

  On Apr 16, 11:14 am, Eong eong.c...@gmail.com wrote:

   I'm afraid it's not a same problem.
   My problem only happenes on Snapdragon phones.
   It's fine on Milestone or Droid. I found a few threads about this but
   no solution.

   On 4月16日, 下午9时15分, Felipe Silveira webfel...@gmail.com wrote:

Just a guess: It can be the same error reported 
here:http://code.google.com/p/android/issues/detail?id=7520

Take a look...

Felipe Silveirahttp://www.felipesilveira.com.br

On Fri, Apr 16, 2010 at 8:40 AM, Eong eong.c...@gmail.com wrote:
 Hi,
 We are developing 2D games. And we found our game works fine except
 the snapdragon chips, like Nexus one and Liquid A1. It even runs fine
 on G1.

 We use GLSurfaceView, and we useglTexImage2Dand glTexIsubmage2D to
 put on the text and then draw.
 TheglTexImage2Dclass take more than 100ms on Nexus one (1024x512 pix
 tex). It's very strange, G1 is even faster than this.
 If anyone know something about this?

 -Code
 snip---
                                        
 gl.glClear(GL10.GL_COLOR_BUFFER_BIT
 | GL10.GL_DEPTH_BUFFER_BIT);

  gl.glTexSubImage2D(GL10.GL_TEXTURE_2D, 0, 0, 0, m_width,
 m_height, GL10.GL_RGB, GL_UNSIGNED_SHORT_5_6_5, m_byteCanvas);

                                        ((GL11Ext)gl).glDrawTexiOES(0, 
 0, 0,
 m_width, m_height);

 --
 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%2Bunsubs
  cr...@googlegroups.com
 For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Felipe Silveira
Engenharia da Computação
Universidade Federal de Itajubáhttp://www.felipesilveira.com.br
MSN: felipeuni...@hotmail.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 
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 
   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 
  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 
 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, 

[android-developers] Re: getting rid of “warning: unmappable character for encoding ascii”

2010-04-17 Thread Lo'oris
On Apr 15, 11:42 pm, Bob Kerns r...@acm.org wrote:
 I'm afraid that nobody is going to help you, because you don't give
 enough context to indicate just what tool is giving this message.

I don't understand, I told I got this message compiling with ant (ant
debug, ant release, etc.)

I'm editing with TextMate (OSX 10.5) and I *did* save the files as
UTF-8.

[javac] Compiling 12 source files to /Users/looris/Sviluppo/
android/projects/toutry/bin/classes
[javac] /Users/looris/Sviluppo/android/projects/toutry/src/net/
looris/toutry/Stuff.java:23: warning: unmappable character for
encoding ascii
[javac] return (poked=false); // NOTA: è
un'assegnazione, non un controllo!
[javac]^

-- 
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: Avoid restarting http request on orientation change

2010-04-17 Thread patbenatar
Awesome. Thanks Bob! This has been very informative. I will pursue
this route :)



On Apr 16, 11:47 pm, Bob Kerns r...@acm.org wrote:
 You are 100% on the right track; this calls for a service.

 As for what happens when your activity is no longer running -- well,
 let's consider that.

 First, if your activity is simply no longer the current activity --
 the user may have pressed Home, for example -- he may switch back to
 it. You'd like to have actually made some progress in the meantime --
 especially if he left because he was tired of waiting for the
 transfer. You probably want to let the transfer continue until
 onDestroy() is called on your Activity, at which point you can stop
 the service.

 If your activity is truly gone -- well, would that information be
 useful if he started up your program again later? If so, you might
 want to consider allowing the transfer to finish, and caching the
 result. In this model, the activity's onDestroy() method leaves the
 service alone, and the service calls stopSelf() when it's done. Next
 time it's started for this purpose, it can check for the cached data
 and immediately supply that.

 If caching is inappropriate, and you want it to only run when the
 Activity is still alive, then use bindServce() instead of
 startService(), and  unbind the service in the Activity's onDestroy().
 The Service can track how many bindings are active, and exit early out
 of its loop reading the data. You couldn't do any better than this at
 stopping the activity even if you were doing it in the Activity
 anyway.

 On Apr 16, 9:57 pm, patbenatar patbena...@gmail.com wrote:





  Hey all-

  I've run into an interesting little issue.. My loader Activity fetches
  data from a web API, starting an http request and waiting for the
  result.. Now what if the user flips their phone mid-http request? The
  Activity is destroyed and restarted, thus the http request restarts as
  well. The fact that my Activity is being destroyed on orientation
  change is all good by me, I understand the way Android works, I'm just
  looking for a solution to avoid restarting the http request on every
  orientation change..

  I'm thinking the solution would be Services... I could run a Service
  in the background to do the http request and when it finishes, call
  back to my Activity and let it handle the data and finish up. The one
  thing I'm a bit weirded out about is what if the user closes my app
  before the Service's http request finishes? What will it do with the
  data if the Activity that needs it is no longer running?

  Thoughts, feedback, ideas, etc would be great!

  Thanks,
  Nick

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


Re: [android-developers] VideoView causing an error

2010-04-17 Thread Mark Murphy
Matthew Patience wrote:
 I am attempting to make a VideoView to obviously play videos on. When
 I use the following code though I get the error Cannot cast from View
 to VideoView on the marked line below.
 
 public class VideoView extends Activity {
 
   private String video_link;
   private VideoView video_view;
 
   @Override
   public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.youtube_player);
 
   video_view = (VideoView) findViewById(R.id.video_view); ***ERROR
 Cannot cast from View to VideoView
 
   Bundle video_bundle = getIntent().getExtras();
   video_link = video_bundle.getString(LINK);
 
   }
 
 }
 
 I have pretty much copied exactly what is shown in the API Demo
 included in the SDK. Not sure what I've done wrong.

You have named your Activity subclass VideoView. That name will take
preference over android.widget.VideoView. I would recommend you change
the name of the activity to something that won't collide with an SDK class.

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


Re: [android-developers] Re: Is there a concept like DLL in Androids?

2010-04-17 Thread Mark Murphy
Bob Kerns wrote:
 If I have a service used by
 several applications, I currently have to supply it in every
 application, and arrange to negotiate just which one actually provides
 the service.

That's not the only option -- see below.

 The alternative, of a separate APK is prohibitive because it depends
 on the user seeing the dependency, understanding what to do about it,
 and taking action.

Those three steps can be handled by the application that has the dependency.

If your application requires other capabilities:

-- use PackageManager to see if the required component is there

-- if not, pop up a dialog saying that you need to download/install the
dependency before you can continue (or before certain features are enabled)

-- start up the relevant Market Uri, or download and kick off the
installation yourself, depending on how the component is distributed

 However, if we could declare in our manifest that a package *requires*
 package, and the Market handled this, most of our problems would be
 solved.

It would certainly solve all of the above problems, and related ones
(e.g., uninstalling no-longer-needed applications once whatever depended
on them is uninstalled, warning a user if they try to uninstall
something that somebody else depends upon). I suspect it will introduce
new and exciting problems, but that remains to be seen.

FWIW, I suggested this about a year ago and the notion was squashed.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | 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: Cant login into android market. Market down?

2010-04-17 Thread powder

I had this too, next day it was gone...

On Apr 16, 1:14 am, Joël Bourquard joel.bourqu...@gmail.com wrote:
 When I go tohttp://market.android.com/publish/Home

 I get a HTTP 404 error.

 Hope this is resolved soon...

 --
 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: Listview with button on same activity

2010-04-17 Thread patbenatar
I would recommend looking into the source code for the Clock app in
2.1... In the Activity in which the user sets all the options for an
alarm there is code that takes the options preference list and adds a
button bar across the bottom. The Android stock apps [Browser, Email,
SMS, etc] are all available open-source and are great tools for
learning.

But basically what they do in the Clock app is to programmatically
divide up the screen space so your button bar will show on screen with
your ListView.

-Nick




On Apr 16, 11:19 pm, Er. syed imran ali imran...@gmail.com wrote:
 Hi all,
 i tried a lot but i did not success,
 my problem is i want to add first one button and below that one
 listview.
 for that i divided my xml in two Linearlayout as below in code but it
 is not
 working when i am hiding button code then list view is coming other
 wise only
 button is coming on the screen.
 please find out my error in xml or any thing i have to do in .java
 file

 my xml code is.

 ?xml version=1.0 encoding=UTF-8?

 LinearLayout
      xmlns:android=http://schemas.android.com/apk/res/android;
     android:orientation=horizontal
     android:layout_width=fill_parent
         android:layout_height=fill_parent
         style=@style/MainBody
     

    AbsoluteLayout
     android:layout_width=fill_parent
     android:layout_height=80px
     android:gravity=top
         android:padding=10px
     

      TextView android:layout_width=fill_parent
                 android:layout_height=wrap_content
                 android:textColor=#00
                 android:textSize=20sp
                 android:layout_x=15px
         android:layout_y=10px
                  android:textStyle=bold
                  android:text=Inspection  /

          ImageButton android:id=@+id/button_add
          android:layout_width=wrap_content
      android:layout_height=wrap_content
      android:layout_x=175px
      android:layout_y=1px
      android:background=@drawable/add_plus
      /ImageButton

 /AbsoluteLayout

  LinearLayout
     android:orientation=vertical
     android:layout_width=fill_parent
         android:layout_height=wrap_content
          android:layout_x=10px
      android:layout_y=90px
         android:padding=10px
         android:gravity=bottom
     android:background=@drawable/myhelper_border
     

     ListView android:id=@+id/listview_insp
         android:layout_width=fill_parent
         android:layout_height=fill_parent
         android:layout_x=10px
      android:layout_y=190px
       android:background=@drawable/myhelper_border
          /
     /LinearLayout

  /LinearLayout

 Thanks and regards
 Syed Imran Ali

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

2010-04-17 Thread patbenatar
I can't answer your question as is, but I can say this: the JodaTime
library is a far superior API than the standard Java date/time/
calendar classes.

-Nick



On Apr 15, 11:19 pm, Ajay aja...@gmail.com wrote:
 Hi,
    I am using the switchTimezone() method of the Time class. I am not
 sure what string should be passed to convert the time to a different
 time zone. For example: My current time zone is +5:30 GMT and current
 time is 11:30 AM (+5:30 GMT) and I call the switchTimeZone() by
 passing a string America/California. I was expecting the result to
 be 11:00 PM (-7 PDT), but I got the result as 6:00 AM, which I guess
 is the UTC time. Any idea what could be the issue here?

 Thanks,
 AJ

 --
 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] Highlight part of the text in a textview object

2010-04-17 Thread Sebastian Müller
Thanks a lot for your answer. This works great for the Bold thing, but
background isnt changing...do you know why??

my Code:

if (index = 0) {
  Spannable str = (Spannable) chapterResult.getText();
   str.setSpan(new BackgroundColorSpan(0xFF), index, index +
searchQuery.getAll().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
   str.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), index,
index + searchQuery.getAll().length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}

-- 
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] merge tag in ListView item resource layout?

2010-04-17 Thread westmeadboy
Is it possible use the merge tag in the layout XML for a List item? In
particular, when using a SimpleCursorAdapter?

-- 
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 is update performed !

2010-04-17 Thread klaus johan

Hi,

Could someone describe to me what happens when an android application
is updated? Is it the old version uninstalled and then installed the
new one ? What about the resources the application might need ?

-- 
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] merge tag in ListView item resource layout?

2010-04-17 Thread Mark Murphy
westmeadboy wrote:
 Is it possible use the merge tag in the layout XML for a List item? In
 particular, when using a SimpleCursorAdapter?

Let's say that you are using R.layout.row with your SimpleCursorAdapter.

If res/layout/row.xml were to look like:

merge
!-- stuff here --
/merge

that probably will not work, since there is no container for the row's
widgets.

But, if res/layout/row.xml were to look like:

RelativeLayout
include layout=@layout/more_stuff /
!-- whatever --
/RelativeLayout

and if res/layout/more_stuff.xml were to look like:

merge
!-- stuff here --
/merge

that should be OK.

I have not tried this, so what I have written is an educated guess.

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

_Beginning Android 2_ from Apress Now Available!

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


[android-developers] Re: merge tag in ListView item resource layout?

2010-04-17 Thread westmeadboy
Yeah, I was wondering whether the Adapter (or whatever) internally
creates some container to put the item layout into. But just using
merge (without the include approach you mentioned) does not work.

While using the merge-via-include approach may be useful to some, it
doesn't help in my particular situation because that RelativeLayout is
exactly the sort of thing I'm trying to eliminate :(

On Apr 17, 3:50 pm, Mark Murphy mmur...@commonsware.com wrote:
 westmeadboy wrote:
  Is it possible use the merge tag in the layout XML for a List item? In
  particular, when using a SimpleCursorAdapter?

 Let's say that you are using R.layout.row with your SimpleCursorAdapter.

 If res/layout/row.xml were to look like:

 merge
         !-- stuff here --
 /merge

 that probably will not work, since there is no container for the row's
 widgets.

 But, if res/layout/row.xml were to look like:

 RelativeLayout
         include layout=@layout/more_stuff /
         !-- whatever --
 /RelativeLayout

 and if res/layout/more_stuff.xml were to look like:

 merge
         !-- stuff here --
 /merge

 that should be OK.

 I have not tried this, so what I have written is an educated guess.

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

 _Beginning Android 2_ from Apress Now Available!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 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


Re: [android-developers] Re: merge tag in ListView item resource layout?

2010-04-17 Thread Mark Murphy
westmeadboy wrote:
 Yeah, I was wondering whether the Adapter (or whatever) internally
 creates some container to put the item layout into.

Nope.

 While using the merge-via-include approach may be useful to some, it
 doesn't help in my particular situation because that RelativeLayout is
 exactly the sort of thing I'm trying to eliminate :(

Why are you trying to eliminate it?

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

_Beginning Android 2_ from Apress Now Available!

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


[android-developers] Re: merge tag in ListView item resource layout?

2010-04-17 Thread westmeadboy
Just playing with optimization after watching this video:

http://www.youtube.com/watch?v=UApv-ZMJ51g

(play at about 44:00)

He talks about using merge because nested views/layouts are much more
expensive than, say, using wider hierarchies.

On Apr 17, 3:58 pm, Mark Murphy mmur...@commonsware.com wrote:
 westmeadboy wrote:
  Yeah, I was wondering whether the Adapter (or whatever) internally
  creates some container to put the item layout into.

 Nope.

  While using the merge-via-include approach may be useful to some, it
  doesn't help in my particular situation because that RelativeLayout is
  exactly the sort of thing I'm trying to eliminate :(

 Why are you trying to eliminate it?

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

 _Beginning Android 2_ from Apress Now Available!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 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


Re: [android-developers] Re: merge tag in ListView item resource layout?

2010-04-17 Thread Mark Murphy
westmeadboy wrote:
 Just playing with optimization after watching this video:
 
 http://www.youtube.com/watch?v=UApv-ZMJ51g
 
 (play at about 44:00)
 
 He talks about using merge because nested views/layouts are much more
 expensive than, say, using wider hierarchies.

That is certainly true. However, you cannot get rid of the container
(e.g., RelativeLayout) that forms the basis of each row in a ListView.

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

Android 2.x Programming Books: http://commonsware.com/books

-- 
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] moveTaskToBack returning false.

2010-04-17 Thread Prajakta Shitole
Yes that works.. Thanks a lot.

Thanks,
Prajakta

On Sat, Apr 17, 2010 at 2:20 AM, Paul Townsend deer...@googlemail.comwrote:

 Hi I found this maybe this will help

 http://osdir.com/ml/Android-Developers/2010-03/msg01903.html

 On 16 Apr 2010 22:02, ~ TreKing treking...@gmail.com wrote:

 On Fri, Apr 16, 2010 at 3:53 PM, Prajakta Shitole prajakt...@gmail.com
 wrote:

 
  no i dint because the documentation says that for any activity other than
 main activity u need t...

 Oh yeah, I read that wrong ... oh well, there goes that ... good luck.




 -
 ...

  --
 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: Android Preferences

2010-04-17 Thread Abhinav
Thank you for the information.

I have another doubt

I was going through the source code of Preference, PreferenceManager
and PreferenceActivity in order to understand the preference framework
of android.

According to the documentation, the Preference class does the job of
inflating the preference UI from an XML file and also takes care of
persisting the preferences
to the SharedPreferences, and I confirmed this from the source code.

PreferenceActivity is used in order to display the inflated preference
UI onto the screen

I am confused as to how the PreferenceManager class fits into this
scheme. Does the PreferenceManager have any role to play in the
persistence? What is the link between these three classes?

In addition, once the xml file has been loaded using
addPreferenceFromResource()  how do I access the preferences file; do
I create an instance of PreferenceManager and use the
getDefaultSharedPreferences() function or directly create a
SharedPreferences object and use the getSharedPreferences() function?

Abhinav

On Apr 17, 11:20 am, ~ TreKing treking...@gmail.com wrote:
 On Fri, Apr 16, 2010 at 12:14 AM, Abhinav abhinav.abhic...@gmail.comwrote:

  What is the difference between Preference.OnPreferenceChangeListener and
  Preference.OnPreferenceClickListener?

 Going to go out on a limb and take a massive stab in the dark ... but ...
 maybe, on tells you when a preference was CHANGED and one tells you a
 preference was CLICKED.
 Just a guess though. I guess I could take a look at the documentation to
 find out for sure, since it's right there in the description for each ...
 but that would be too easy.

 http://developer.android.com/intl/de/reference/android/preference/Pre...

 http://developer.android.com/intl/de/reference/android/preference/Pre...http://developer.android.com/intl/de/reference/android/preference/Pre...

 -
 TreKing - Chicago transit tracking app for Android-powered 
 deviceshttp://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.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] Implement Camera Support for Android Emulator using Web Cam

2010-04-17 Thread Thisara Rupasinghe
Hi,

I'm interested in implementing the Camera support for Android emulator using
webcam. Therefore these days im looking into android emulators source code
for get some information regarding this.

And I'm thinking of using GStreamer for access webcam. But since this is
linux library this wont work for windows system. Is there anything that will
work on both of these platforms. What is the strategy used in the android
emulator to achieve the platform independence?
And can't we use the same thing to make webcam implementation work both on
windows and linux?

Please help if you are aware of these things.

-- 
Thanks  Regards,
Thisara.

-- 
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] SlidingDrawer handle

2010-04-17 Thread Pinheiro
Hi!
Quick question: what is the drawable ID of the handle for the
application's SlidingDrawer used in the home screen?
Thanks in advance!

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


[android-developers] Starting activity witouth window from widget

2010-04-17 Thread Dirk Vranckaert
I recently (yesterday in fact :)) started creating widgets. So my
first widget I want to create is something like:
* A 2x2 widget
* Containing 2 buttons
* Button 1: Register current time and location
* Button 2: Open up an activity where configuration can be
modified, registered times and location can be viewed,...

Now the problem for me is button 1. As I only try to do some
registration data (so no further user input required after pressing
the button) I would like to just show a loading bar and after wards
Toast a message to screen, or a popup if anything goes wrong.
This is what I do now:
* In my widgetProvider
Intent intent = new Intent(context, LogDataActivity.class);
PendingIntent pintent = PendingIntent.getActivity(context, 0, intent,
0);

RemoteViews views = new RemoteViews(context.getPackageName(),
R.layout.my_widget_view);
views.setOnClickPendingIntent(R.id.startButton, pintent);

* In my LogDataActivity class
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

//Do some of my stuff

Toast.makeText(LogDataActivity.this, Success,
Toast.LENGTH_LONG).show();

super.finish();
}

So what happens: I click the button, a plain black screen pops up
(Altough I did not specify a layout upon creating the activity), and
after my work is done the Toast shows up and the activity gets
'killed'.
Basically that is what I want to do except for the black screen to
show up. Is it possible not to show a screen upon creating the
activity?

-- 
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: Starting activity witouth window from widget

2010-04-17 Thread Dirk Vranckaert
Sorry all for bothering.
I didn't look well enough in this group, now I found the answer:
http://groups.google.com/group/android-developers/browse_thread/thread/8ac30e3b1870fb98/1cc71bab92a7ff97?lnk=gstq=Starting+activity+without+layout#1cc71bab92a7ff97

:)

On 17 apr, 18:45, Dirk Vranckaert dirkvrancka...@gmail.com wrote:
 I recently (yesterday in fact :)) started creating widgets. So my
 first widget I want to create is something like:
 * A 2x2 widget
 * Containing 2 buttons
     * Button 1: Register current time and location
     * Button 2: Open up an activity where configuration can be
 modified, registered times and location can be viewed,...

 Now the problem for me is button 1. As I only try to do some
 registration data (so no further user input required after pressing
 the button) I would like to just show a loading bar and after wards
 Toast a message to screen, or a popup if anything goes wrong.
 This is what I do now:
 * In my widgetProvider
 Intent intent = new Intent(context, LogDataActivity.class);
 PendingIntent pintent = PendingIntent.getActivity(context, 0, intent,
 0);

 RemoteViews views = new RemoteViews(context.getPackageName(),
 R.layout.my_widget_view);
 views.setOnClickPendingIntent(R.id.startButton, pintent);

 * In my LogDataActivity class
     public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);

                 //Do some of my stuff

                 Toast.makeText(LogDataActivity.this, Success,
 Toast.LENGTH_LONG).show();

                 super.finish();
         }

 So what happens: I click the button, a plain black screen pops up
 (Altough I did not specify a layout upon creating the activity), and
 after my work is done the Toast shows up and the activity gets
 'killed'.
 Basically that is what I want to do except for the black screen to
 show up. Is it possible not to show a screen upon creating the
 activity?

 --
 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: Changing ringer mode to RINGER_MODE_SILENT doesn't prevent the phone from vibrating

2010-04-17 Thread Flo
Today I tried to solve the problem and mute the vibrating phone by
initiating a Vibrator object and calling the method cancel() on it.
But this didn't stopped the vibration either.

Is it possible that you cannot interrupt the vibration of an incoming
call at all?

-- 
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] Modifying components on widget from activity

2010-04-17 Thread Dirk Vranckaert
On my widget I'm having a button and a textView. When clicking that
button some data is registered and I want the TextView to be updated.
However I can't get to the TextView instance from within my Activity
it seems.

Any ideas?

-- 
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] Modifying components on widget from activity

2010-04-17 Thread Mark Murphy
Dirk Vranckaert wrote:
 On my widget I'm having a button and a textView. When clicking that
 button some data is registered and I want the TextView to be updated.
 However I can't get to the TextView instance from within my Activity
 it seems.
 
 Any ideas?

Use a RemoteViews, as that is the only way to update an app widget.

ComponentName me=new ComponentName(this, AppWidget.class);
RemoteViews updateViews=new RemoteViews(apt.tutorial, R.layout.widget);
AppWidgetManager mgr=AppWidgetManager.getInstance(this);

// populate the RemoteViews

mgr.updateAppWidget(me, updateViews);

You will need to substitute in appropriate values for AppWidget and
apt.tutorial, but you should have most of that from your IntentService
or AppWidgetProvider already.

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

Android 2.x Programming Books: http://commonsware.com/books

-- 
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-kernel] Implement Camera Support for Android Emulator using Web Cam

2010-04-17 Thread Thisara Rupasinghe
Hi Karthik,

Thank you very much for ur comments.
Within the emulator didnt it talk to any hardware devices on the machine?

Is there anyone knows abt this pls help...
Can we talk to webcam from the QEMU ARM environment, that is from the
android emulator and the changes need to be done?

On Sat, Apr 17, 2010 at 10:44 PM, karthik poduval karthik.podu...@gmail.com
 wrote:

 Hi,

 To implement a camera device in Android, you need to write a new Camera HAL
 layer. Now between the emulator and real device, there is different HAL for
 emulator and a different one for the real device. Now the emulator Camera
 HAL is basically something that generates a dummy video frame(like
 a virtual video device). In case of the device, the HAL would talk to
 V4L2(Video for Linux) framework to get camera frames.

 You need to modify the emulator HAL and write your own one to support a
 webcam frame. The Android  emulator is based on QEMU ARM virtualization, so
 I am not sure how much QEMU will allow for this activity. You need to
 communicate from a virtualized ARM platform to the native OS video
 routines(Video for Windows in case of windows). I am really nit sure if its
 possible through QEMU. Someone more familiar with QEMU could comment on
 this.

 Regards,
 Karthik Poduval

 On Sat, Apr 17, 2010 at 11:26 AM, Thisara Rupasinghe thisara...@gmail.com
  wrote:

 Hi,

 I'm interested in implementing the Camera support for Android emulator
 using webcam. Therefore these days im looking into android emulators source
 code for get some information regarding this.

 And I'm thinking of using GStreamer for access webcam. But since this is
 linux library this wont work for windows system. Is there anything that will
 work on both of these platforms. What is the strategy used in the android
 emulator to achieve the platform independence?
 And can't we use the same thing to make webcam implementation work both on
 windows and linux?

 Please help if you are aware of these things.

 --
 Thanks  Regards,
 Thisara.

 --
 unsubscribe: 
 android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com
 website: http://groups.google.com/group/android-kernel




 --
 Regards,
 Karthik Venugopal Poduval
 Ph: 09384808733

 --
 unsubscribe: 
 android-kernel+unsubscr...@googlegroups.comandroid-kernel%2bunsubscr...@googlegroups.com
 website: http://groups.google.com/group/android-kernel




-- 
Thanks  Regards,
Thisara.

-- 
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: VideoView causing an error

2010-04-17 Thread Matthew Patience
Wow, thanks so much Mark. I hate when it's something so simple as
that. I guess sometimes you just need an outside person to take a look
to notice the simple problems.

Cheers,

Matt

On Apr 17, 7:02 am, Mark Murphy mmur...@commonsware.com wrote:
 Matthew Patience wrote:
  I am attempting to make a VideoView to obviously play videos on. When
  I use the following code though I get the error Cannot cast from View
  to VideoView on the marked line below.

  public class VideoView extends Activity {

     private String video_link;
     private VideoView video_view;

    �...@override
     public void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.youtube_player);

             video_view = (VideoView) findViewById(R.id.video_view); ***ERROR
  Cannot cast from View to VideoView

             Bundle video_bundle = getIntent().getExtras();
             video_link = video_bundle.getString(LINK);

     }

  }

  I have pretty much copied exactly what is shown in the API Demo
  included in the SDK. Not sure what I've done wrong.

 You have named your Activity subclass VideoView. That name will take
 preference over android.widget.VideoView. I would recommend you change
 the name of the activity to something that won't collide with an SDK class.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|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 
 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: Avoid restarting http request on orientation change

2010-04-17 Thread Dimitris
I would take into consideration that onDestroy() might not get called
always. Usually onPause() is the best place to store/cache data before
you are done because it is guaranteed to get called. Keep in mind not
to do expensive or time consuming operations onPause() because the
other activity that is trying to show won't show until your onPause()
is done.

I recommend reading the Android activity life cycle docs on the
android dev docs.

Enjoy :)

On Apr 17, 3:45 am, patbenatar patbena...@gmail.com wrote:
 Awesome. Thanks Bob! This has been very informative. I will pursue
 this route :)

 On Apr 16, 11:47 pm, Bob Kerns r...@acm.org wrote:



  You are 100% on the right track; this calls for a service.

  As for what happens when your activity is no longer running -- well,
  let's consider that.

  First, if your activity is simply no longer the current activity --
  the user may have pressed Home, for example -- he may switch back to
  it. You'd like to have actually made some progress in the meantime --
  especially if he left because he was tired of waiting for the
  transfer. You probably want to let the transfer continue until
  onDestroy() is called on your Activity, at which point you can stop
  the service.

  If your activity is truly gone -- well, would that information be
  useful if he started up your program again later? If so, you might
  want to consider allowing the transfer to finish, and caching the
  result. In this model, the activity's onDestroy() method leaves the
  service alone, and the service calls stopSelf() when it's done. Next
  time it's started for this purpose, it can check for the cached data
  and immediately supply that.

  If caching is inappropriate, and you want it to only run when the
  Activity is still alive, then use bindServce() instead of
  startService(), and  unbind the service in the Activity's onDestroy().
  The Service can track how many bindings are active, and exit early out
  of its loop reading the data. You couldn't do any better than this at
  stopping the activity even if you were doing it in the Activity
  anyway.

  On Apr 16, 9:57 pm, patbenatar patbena...@gmail.com wrote:

   Hey all-

   I've run into an interesting little issue.. My loader Activity fetches
   data from a web API, starting an http request and waiting for the
   result.. Now what if the user flips their phone mid-http request? The
   Activity is destroyed and restarted, thus the http request restarts as
   well. The fact that my Activity is being destroyed on orientation
   change is all good by me, I understand the way Android works, I'm just
   looking for a solution to avoid restarting the http request on every
   orientation change..

   I'm thinking the solution would be Services... I could run a Service
   in the background to do the http request and when it finishes, call
   back to my Activity and let it handle the data and finish up. The one
   thing I'm a bit weirded out about is what if the user closes my app
   before the Service's http request finishes? What will it do with the
   data if the Activity that needs it is no longer running?

   Thoughts, feedback, ideas, etc would be great!

   Thanks,
   Nick

   --
   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 
  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 
 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: Return value for a PendingIntent launched via a Notification

2010-04-17 Thread ssozonoff
Hello Mark,

Yes thanks, this is what I ended up doing in the end.

Serge

On Apr 16, 9:51 pm, Mark Murphy mmur...@commonsware.com wrote:
 ssozonoff wrote:
  Hello,

  Is is possible to get back a result intent when launching an Intent
  from a Notification?

  Similar to the way startActivityForResult() works ?

 Not directly -- there is nothing to receive the result intent.

 Whatever the user launches from the Notification, though, can arrange to
 broadcast Intents or something to achieve a similar effect.

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

 Android 2.x Programming Books:http://commonsware.com/books

 --
 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] Creating A Bunch of Textviews Programmatically

2010-04-17 Thread Matthew Patience
I need some help with the following scenario, as I am so used to make
all of my layouts with XML, but now I have a situation where that
won't work.

I am working on the second version of my app that delivers news, in
the comments section I used to use a listview to display user
comments, but it doesn't work that great for comments that could be
anywhere from 5  to 500+ characters long. So I want to create a whole
bunch of TextViews in a scrollview and stack them below each other.

My best guess was this, although it is definitely wrong because it
only shows one comment. I assume I have to use some kind of
LayoutParams and so I've looked into it but am still not sure how
exactly to use them. Can anyone suggest a way to do what I want?

for (String comment : comments_list) {

TextView txt_comment = new TextView(this);
txt_comment.setText(comment.toString());
txt_comment.setTextColor(R.color.solid_black);

comment_layout.addView(txt_comment);
}



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] Re: glCopyTexImage2D - Success anyone?

2010-04-17 Thread Robert Green
Have you tried copying it to a power of 2 texture instead of the
viewport dimensions?  I'd test with 512x256 and see if that works.

On Apr 16, 10:22 pm, Andres Colubri andres.colu...@gmail.com wrote:
 Any updates on this one? I have been trying to copy the contents of the
 back buffer into an opengl texture, but without success. I'm using the
 same method mentioned in the first post of this thread:

 gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0,0, w, h, 0);

 where w and h are the current width and height of the screen,
 respectively. This works fine on the emulator, but it returns garbage
 back into the texture on the actual device.
 The phone is a Nexus One.

 On Dec 11 2009, 11:56 pm, scott19_68 sw.cop...@gmail.com wrote:
   Works for me on my HTC Hero - I too could only use RGB and not RGBA.
   Emulator flips the textures upside down though...
  
   Does anyone else have more information regarding other phones?  I have
   an app on the app store that uses this method and I am suspecting that
   it does not work for all current phones.  I get really useful comments
   like 'Does not work on Tattoo - nuff said'...
  
   Not sure if the forum rules prevent me from mentioning my app so PM me
   if you'd like to help out and test - I'd definitely appreciate it very
   much and would be willing to help you out in return regarding OpenGL
   development questions...
  
   On Nov 21, 4:45 pm, Ben Gotow bengo...@gmail.com wrote:
  
    Hey everyone,
  
    I'm porting anOpenGLapp from the iPhone to Android, and I need to
    renderOpenGLcontent to a texture. Since framebuffers are not
    available inOpenGL1.0 and the DROID is the only Android phone to
    support the framebuffer extension, I'm trying to draw usingOpenGLand
    then copy the result into a texture usingglCopyTexImage2D. However,
    my initial findings are not good:
  
    1.glCopyTexImage2Dworks in the Android emulator (OS v. 1.5), but
    only with GL10.GL_RGB, not GL_RGBA. If you try to copy the alpha data
    from the scene into the texture, you just get a completely white
    texture.
  
    2.glCopyTexImage2Ddoesn't seem to work _at all_ on the Android G1.
    It does not throw an UnsupportedOperationException but after calling
    it, the texture is completely white.
  
    Has anyone successfully usedglCopyTexImage2Don an actual device? If
    so, could you please post a bit of the code you're using? I suspect it
    works only with specific settings, if at all. Right now, I'm calling
    it like this:
  
    gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0,0, 256,
    256, 0);

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


Re: [android-developers] Creating A Bunch of Textviews Programmatically

2010-04-17 Thread Mark Murphy
Matthew Patience wrote:
 I need some help with the following scenario, as I am so used to make
 all of my layouts with XML, but now I have a situation where that
 won't work.
 
 I am working on the second version of my app that delivers news, in
 the comments section I used to use a listview to display user
 comments, but it doesn't work that great for comments that could be
 anywhere from 5  to 500+ characters long. 

Why do you feel it doesn't work?

 So I want to create a whole
 bunch of TextViews in a scrollview and stack them below each other.

U...you're going to need something between those layers. Probably a
ScrollView holds a LinearLayout which holds TextViews.

 My best guess was this, although it is definitely wrong because it
 only shows one comment. I assume I have to use some kind of
 LayoutParams and so I've looked into it but am still not sure how
 exactly to use them. Can anyone suggest a way to do what I want?
 
 for (String comment : comments_list) {
 
   TextView txt_comment = new TextView(this);
   txt_comment.setText(comment.toString());
   txt_comment.setTextColor(R.color.solid_black);
 
   comment_layout.addView(txt_comment);
 }

Yes, you need LayoutParams. More importantly, you need a LinearLayout or
something -- a ScrollView only has one child. So, add your TextViews to
the LinearLayout via addView() with a LinearLayout.LayoutParams object.

However, if you are going to have more than a few dozen comments, you
really really really want to roll back to the ListView approach, as your
proposed UI will take up a fair bit of memory and a fair bit of CPU time
to create. The advantage of ListView is that it can show thousands of
comments using only a handful of TextViews -- your approach would
require thousands of TextViews.

-- 
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: NDK / glsl / Es 2.0 advice please?

2010-04-17 Thread Robert Green
Mario certainly covered it!  I recommend just getting the purple book
OpenGL ES 2.0 Programming Guide by Shreiner.  It covers things
pretty well.

In short - ES 2.0 will not project it for you.  You need to do that in
your vertex shader.  It's pretty easy though.  Something like:

uniform mat4 u_matViewProjection;
attribute vec4 a_position;
void main(void) {
  gl_Position = u_matViewProjection * a_position;
}

Should do the trick.



On Apr 17, 4:31 am, Mario Zechner badlogicga...@gmail.com wrote:
 Hi,

 OpenGL ES 2.0 (GLES2) is completely based on writting your own vertex
 and fragment shaders. Both types serve a specific purpose.

 Vertex shaders in their most basic form are responsible for
 transforming the incoming vertex position. This includes moving them
 from object to world space, from world space to camera or view space
 and finally projecting the camera/view space positions.
 Transformations and projections are achieved via matrices which you
 usually pass to your shader as so called uniforms. A vertex shader
 outputs the final vertex position and potentially other information
 for the fragment shader, like interpolated texture coordinates and
 normals. A vertex shader thus has to perform the equivalent of the
 fixed function pipeline transformation and lighting stage (with the
 later often being implemented in the fragment shader instead to get
 per pixel lighting).

 A fragment shader is responsible for outputting a fragments color
 based on various conditions. You might want to fetch a texel from a
 texture as the color, apply phong shading based on interpolated
 normals you receive from the vertex shader and so on.

 As you can see there's various types of parameters and arguments
 involved when programming shaders. In GLES2 there's 3 main types
 (there are other less frequently used types as well): attributes,
 uniforms and varyings. Attributes and uniforms are specified by you
 via calls to glVertexAttrib, glVertexAttribPointer or glUniform.
 Attributes represent vertex attributes like position, texture
 coordintates, per vertex colors or normals. Uniforms are normally used
 to pass in things like transformation and projection matrices that you
 calculate outside the shaders in your program. Varyings are generated
 within the vertex shader and passed to the fragment shader. Popular
 examples would be interpolated texture coordinates or normals for
 phong shading.

 So what does all this mean for your scenario? First, you will need to
 calculate the proper transformation and projection matrices yourself,
 keep track of them yourself and pass them in as uniforms to your
 vertex shader which then uses them to transform and project your
 vertices.

 There is no Android specific GLES2 reference as GLES2 is a standard
 developed by Khronos which keep the API the same for all platforms.
 The only difference between platforms is how to setup the GLES2
 context and buffers. Usually this is done via EGL, another standard by
 Khronos. On Android you can use the GLSurfaceView from the hello-gl2
 example for that purpose and not worry about it.

 To get information on the compilation process you can use the
 functions glGetShaderInfoLog (http://www.opengl.org/sdk/docs/man/xhtml/
 glGetShaderInfoLog.xml) and glGetProgramInfoLog (http://www.opengl.org/
 sdk/docs/man/xhtml/glGetProgramInfoLog.xml). You usually use the first
 one after you compiled a vertex or fragment shader and the second one
 after you linked together a vertex/fragment shader pair to a program.
 This will give you any errors or warnings the compiler produces. Note
 that the output is not standardized and will differ for different GPUs
 and their drivers.

 My advice would be to get the OpenGL ES 2.0 Programming Guide, a nice
 little book by the writers of the GLES2 standard which will guide you
 through all the features and standard procedures of GLES2. The basic
 concepts of GLES1 are still there in GLES2, however, you have a
 greater flexibility by providing your own implementation for various
 stages of the fixed function pipeline, including for example the
 transform and lighting stage.

 hth,
 Mario

 On 16 Apr., 06:20, HaMMeReD adamhamm...@gmail.com wrote:





  Working with NDK here.

  How are perspective correct projection supposed to occur in es 2.0. I
  can currently draw my geometry to the screen, but it is not getting
  transformed to 2d.

  Is there some sort of way of getting meaningful compiler errors out of
  the shader compiler?

  Is there a android specific reference to glsl support on it?

  Am I even supposed to be doing projections in my glsl?

  I was using hello-gl2 as a baseline, and then modified it to load
  additional geometry, which is rendering correctly although flat,
  without any translation or projection. Any advice on translation/
  projection is appreciated too, since it seems that all of that has
  disappeared from es2.0.

  I've got a opengl 1.1 live screensaver that I've developed that I want
  

[android-developers] Re: Creating A Bunch of Textviews Programmatically

2010-04-17 Thread Matthew Patience
In that case, I shall stick with the ListView for now. I was just
trying to make it look better as I still have trouble trying to
implement Fancy ListViews.

On Apr 17, 2:50 pm, Mark Murphy mmur...@commonsware.com wrote:
 Matthew Patience wrote:
  I need some help with the following scenario, as I am so used to make
  all of my layouts with XML, but now I have a situation where that
  won't work.

  I am working on the second version of my app that delivers news, in
  the comments section I used to use a listview to display user
  comments, but it doesn't work that great for comments that could be
  anywhere from 5  to 500+ characters long.

 Why do you feel it doesn't work?

  So I want to create a whole
  bunch of TextViews in a scrollview and stack them below each other.

 U...you're going to need something between those layers. Probably a
 ScrollView holds a LinearLayout which holds TextViews.

  My best guess was this, although it is definitely wrong because it
  only shows one comment. I assume I have to use some kind of
  LayoutParams and so I've looked into it but am still not sure how
  exactly to use them. Can anyone suggest a way to do what I want?
  
  for (String comment : comments_list) {

                     TextView txt_comment = new TextView(this);
                     txt_comment.setText(comment.toString());
                     txt_comment.setTextColor(R.color.solid_black);

                     comment_layout.addView(txt_comment);
  }

 Yes, you need LayoutParams. More importantly, you need a LinearLayout or
 something -- a ScrollView only has one child. So, add your TextViews to
 the LinearLayout via addView() with a LinearLayout.LayoutParams object.

 However, if you are going to have more than a few dozen comments, you
 really really really want to roll back to the ListView approach, as your
 proposed UI will take up a fair bit of memory and a fair bit of CPU time
 to create. The advantage of ListView is that it can show thousands of
 comments using only a handful of TextViews -- your approach would
 require thousands of TextViews.

 --
 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 
 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: how is update performed !

2010-04-17 Thread theSmith
The old version isn't so much as uninstalled as it is updated.  All
external resources like shared preferences, databases etc (your app's /
data/ folder) are not removed.  If you have something on the sd card
it is not removed.

Everything else gets removed and updated, including all the drawables
and layouts in your projects /res/ folder.

---
Creator of My College Life
http://mycollegelife.org


On Apr 17, 1:49 pm, klaus johan rantra...@gmail.com wrote:
 Hi,

 Could someone describe to me what happens when an android application
 is updated? Is it the old version uninstalled and then installed the
 new one ? What about the resources the application might need ?

 --
 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: Creating A Bunch of Textviews Programmatically

2010-04-17 Thread patbenatar
Matthew-

For learning to custom style your ListView, look into Android UI
Styles  Themes [there's a good article over at developer.android.com
on this topic]. In a way they're like CSS, allowing you to apply
certain style traits to certain elements..

A great resource for learning UI is the open-source stock Android apps
[Browser, Email, SMS, Clock, etc]... You can find and download these
source packages by searching Google for android source.

Definitely stick with the ListView as it is designed to recycle Views,
keeping in memory only enough Views needed to fill the user's screen.
You can learn to style the ListView in any way you like.

-Nick




On Apr 17, 12:14 pm, Matthew Patience matthewj.patie...@gmail.com
wrote:
 In that case, I shall stick with the ListView for now. I was just
 trying to make it look better as I still have trouble trying to
 implement Fancy ListViews.

 On Apr 17, 2:50 pm, Mark Murphy mmur...@commonsware.com wrote:





  Matthew Patience wrote:
   I need some help with the following scenario, as I am so used to make
   all of my layouts with XML, but now I have a situation where that
   won't work.

   I am working on the second version of my app that delivers news, in
   the comments section I used to use a listview to display user
   comments, but it doesn't work that great for comments that could be
   anywhere from 5  to 500+ characters long.

  Why do you feel it doesn't work?

   So I want to create a whole
   bunch of TextViews in a scrollview and stack them below each other.

  U...you're going to need something between those layers. Probably a
  ScrollView holds a LinearLayout which holds TextViews.

   My best guess was this, although it is definitely wrong because it
   only shows one comment. I assume I have to use some kind of
   LayoutParams and so I've looked into it but am still not sure how
   exactly to use them. Can anyone suggest a way to do what I want?
   
   for (String comment : comments_list) {

                      TextView txt_comment = new TextView(this);
                      txt_comment.setText(comment.toString());
                      txt_comment.setTextColor(R.color.solid_black);

                      comment_layout.addView(txt_comment);
   }

  Yes, you need LayoutParams. More importantly, you need a LinearLayout or
  something -- a ScrollView only has one child. So, add your TextViews to
  the LinearLayout via addView() with a LinearLayout.LayoutParams object.

  However, if you are going to have more than a few dozen comments, you
  really really really want to roll back to the ListView approach, as your
  proposed UI will take up a fair bit of memory and a fair bit of CPU time
  to create. The advantage of ListView is that it can show thousands of
  comments using only a handful of TextViews -- your approach would
  require thousands of TextViews.

  --
  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 
  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 
 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: SlidingDrawer handle

2010-04-17 Thread Bob Kerns
It's a quick question you should be asking yourself. More useful than
doing it for you, I'll tell you how.

Go to your SDK. In the platforms directory, choose your platform
version. Inside there is a data directory, and inside that is the
system's res directory.

Go into the drawables/ directory (most actual images are in e.g.
drawables-hdpi/) and look there for what you want. This would probably
be a .9.png file; the part before that in the filename would be the
id.

But many images are actually referenced as part of selectors, etc.
These drawables are defined as .xml files in the drawables/
directory.  So sometimes you have to work backwards from the actual
image to find the appropriate xml file to find the ID you really want.

On Windows, you can choose a view for these directories that shows a
preview (icon) for each .png file. This makes it a lot easier to
locate what you're looking for.

Remember, these are accessed with android.R.drawable.id, rather than
your own, which are accessed with your-apk-package-name.R.id.

The other approach is that if you know a system layout that uses what
you're looking for, you can look at that layout and see the ID that
it's using.

On Apr 17, 9:30 am, Pinheiro rui.c.pinhe...@gmail.com wrote:
 Hi!
 Quick question: what is the drawable ID of the handle for the
 application's SlidingDrawer used in the home screen?
 Thanks in advance!

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group 
 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] CheckedTextView tutorial

2010-04-17 Thread raqz
Hi,
I need to display contents of a list of objects. Capture the selected
items and later process it. I have been trying to find a tutorial on
net but in vain.
Could some one please advise me when can I find a tutorial.
I know how to display a list but I want the CheckedTextView option.

Thanks,
Raqeeb

-- 
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: requestLocationUpdates issue

2010-04-17 Thread Tejas
Ah... I got this working. Still I'm not sure of the reason for this
(some thread issue I suppose) It would be great if someone can throw
some light on this.

I was instantiating the sensor class in a background service.So the
thread in which it was running was different than the main thread.
I was doing something like this:

public class ManagerService extends Service {

private final String LTAG = this.getClass().getName();
private volatile Looper mServiceLooper;
private volatile ServiceHandler mServiceHandler;

private final class ServiceHandler extends Handler{
public ServiceHandler(Looper myLooper) {
super(myLooper);
}

public void handleMessage(Message msg) {
Log.v(LTAG, handleMessage Called);
super.handleMessage(msg);

// Class Instantiation
GPSSensor gs = new GPSSensor();
gs.setContext(getApplicationContext());
gs.startSensing()


// Main service loop
while(CARuntimes.MainServiceRunFlag == true){
Log.v(LTAG, In service Loop);
// Do something

SystemClock.sleep(6);

}//while

}
}

public void onCreate() {
super.onCreate();
HandlerThread myThread = new HandlerThread(Main Service 
Thread);
myThread.start();

mServiceLooper = myThread.getLooper();
mServiceHandler = new ServiceHandler(mServiceLooper);
}

public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);

Message msg = mServiceHandler.obtainMessage();
//msg.obj = blah blah
mServiceHandler.sendMessage(msg);

}


public void onDestroy() {
Log.v(LTAG, onDestroy called, quitting looper);
super.onDestroy();

mServiceLooper.quit();
}

public IBinder onBind(Intent arg0) {
return null;
}

}


So, I was instantiating the GPSSensor in the handleMessage method. I
moved this to the onStart method and it started working.
I'm not sure why it wasn't working earlier and now has started working
with this change.
It will be great if anyone can explain this.

Cheers,
Tejas

On Apr 17, 1:59 am, Tejas tej...@gmail.com wrote:
 Hi,

 My class listed below is not working. No idea whatsoever. The
 onLocationChanged method is never getting called !
 I checked the logs for any errors/exceptions. I have the required
 permissions set (fine and course locations).
 I doubt the Context I'm setting from the caller. I'm using
 getApplicationContext() to pass to the setContext method in this
 class.
 Can anyone please help ?

 public class GPSSensor implements CASensor {

         private String LTAG = this.getClass().getName();
         Context myContext;
         private String GPSData;
         public LocationManager lMgr;
         public LocationListener myLocListener = new LocationListener() {

                 public void onStatusChanged(String provider, int status, 
 Bundle
 extras) {
                         Log.v(LTAG, === Here 1 );
                 }

                 public void onProviderEnabled(String provider) {
                         Log.v(LTAG, === Here 2 );
                 }

                 public void onProviderDisabled(String provider) {
                         Log.v(LTAG, === Here 3 );
                 }

                 public void onLocationChanged(Location location) {
                         if (location != null){
                                 GPSData = location.getLatitude() + , + 
 location.getLongitude();
                                 Log.v(LTAG, GPS data received ===  
 + GPSData);
                         }
                         else
                                 Log.v(LTAG, Location is null === );
                 }
         };

         public String getCurrentData() {
                 return GPSData;
         }

         public void setContext(Context context) {
                 myContext = context;
         }

         public boolean startSensing() {
                 if (myContext == null){
                         Log.w(LTAG, myContext not set);
                         return false;
                 }
                 Log.v(LTAG, Starting location updates !);

                 lMgr = (LocationManager)
 myContext.getSystemService(Context.LOCATION_SERVICE);
                 lMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 
 0,
 myLocListener);
                 
 

[android-developers] Error generating final archive: duplicate entry: AndroidManifest.xml

2010-04-17 Thread Buurd
HI!

I've got the old duplicate entry-error on AndroidManifest.xml. Since
it is a common problem I tried to use the common solution and started
to investigate the jar-files that I'm importing into my project.
Suprise, suprise, there was no extra AndroidManifest.xml in the jar-
files.

So now I'm a little bit puzzled. I get an error that complains about
finding two AndroidManifest.xml but there are no AndroidManifest.xml
in the jar-files that my project are dependant on. I'll guess that I
have missed something somewhere but I'm out of ideas from where the
extra file comes from.

Is there a way to get a more speaking message. Things like from where
the file are being copied from for instance...

Thanks in advance
Roland

-- 
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] CheckedTextView tutorial

2010-04-17 Thread Mark Murphy
raqz wrote:
 Hi,
 I need to display contents of a list of objects. Capture the selected
 items and later process it. I have been trying to find a tutorial on
 net but in vain.
 Could some one please advise me when can I find a tutorial.
 I know how to display a list but I want the CheckedTextView option.

I use CHOICE_MODE_MULTIPLE in this tutorial from one of my books:

http://github.com/commonsguy/cw-andtutorials/tree/master/20-Notifications/

However, that is a bit involved, as it's halfway through the book.

You can see CHOICE_MODE_MULTIPLE in use here:

http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/List11.html

To get the selections you would use isItemChecked() on ListView.

-- 
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: Creating A Bunch of Textviews Programmatically

2010-04-17 Thread Matthew Patience
Great, thanks a lot.

I'll take a look at those places.

On Apr 17, 4:05 pm, patbenatar patbena...@gmail.com wrote:
 Matthew-

 For learning to custom style your ListView, look into Android UI
 Styles  Themes [there's a good article over at developer.android.com
 on this topic]. In a way they're like CSS, allowing you to apply
 certain style traits to certain elements..

 A great resource for learning UI is the open-source stock Android apps
 [Browser, Email, SMS, Clock, etc]... You can find and download these
 source packages by searching Google for android source.

 Definitely stick with the ListView as it is designed to recycle Views,
 keeping in memory only enough Views needed to fill the user's screen.
 You can learn to style the ListView in any way you like.

 -Nick

 On Apr 17, 12:14 pm, Matthew Patience matthewj.patie...@gmail.com
 wrote:



  In that case, I shall stick with the ListView for now. I was just
  trying to make it look better as I still have trouble trying to
  implement Fancy ListViews.

  On Apr 17, 2:50 pm, Mark Murphy mmur...@commonsware.com wrote:

   Matthew Patience wrote:
I need some help with the following scenario, as I am so used to make
all of my layouts with XML, but now I have a situation where that
won't work.

I am working on the second version of my app that delivers news, in
the comments section I used to use a listview to display user
comments, but it doesn't work that great for comments that could be
anywhere from 5  to 500+ characters long.

   Why do you feel it doesn't work?

So I want to create a whole
bunch of TextViews in a scrollview and stack them below each other.

   U...you're going to need something between those layers. Probably a
   ScrollView holds a LinearLayout which holds TextViews.

My best guess was this, although it is definitely wrong because it
only shows one comment. I assume I have to use some kind of
LayoutParams and so I've looked into it but am still not sure how
exactly to use them. Can anyone suggest a way to do what I want?

for (String comment : comments_list) {

                   TextView txt_comment = new TextView(this);
                   txt_comment.setText(comment.toString());
                   txt_comment.setTextColor(R.color.solid_black);

                   comment_layout.addView(txt_comment);
}

   Yes, you need LayoutParams. More importantly, you need a LinearLayout or
   something -- a ScrollView only has one child. So, add your TextViews to
   the LinearLayout via addView() with a LinearLayout.LayoutParams object.

   However, if you are going to have more than a few dozen comments, you
   really really really want to roll back to the ListView approach, as your
   proposed UI will take up a fair bit of memory and a fair bit of CPU time
   to create. The advantage of ListView is that it can show thousands of
   comments using only a handful of TextViews -- your approach would
   require thousands of TextViews.

   --
   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 
   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 
  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 
 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: CheckedTextView tutorial

2010-04-17 Thread raqz
Thats great! Thanks.. I was not able to view your
http://github.com/commonsguy/cw-andtutorials/tree/master/20-Notificat...
but I am looking into the other link that you provided.

Thanks

On Apr 17, 5:09 pm, Mark Murphy mmur...@commonsware.com wrote:
 raqz wrote:
  Hi,
  I need to display contents of a list of objects. Capture the selected
  items and later process it. I have been trying to find a tutorial on
  net but in vain.
  Could some one please advise me when can I find a tutorial.
  I know how to display a list but I want the CheckedTextView option.

 I use CHOICE_MODE_MULTIPLE in this tutorial from one of my books:

 http://github.com/commonsguy/cw-andtutorials/tree/master/20-Notificat...

 However, that is a bit involved, as it's halfway through the book.

 You can see CHOICE_MODE_MULTIPLE in use here:

 http://developer.android.com/resources/samples/ApiDemos/src/com/examp...

 To get the selections you would use isItemChecked() on ListView.

 --
 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 
 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: Rendering scaled bitmap with high fps

2010-04-17 Thread MrChaz
That's an awfully large texture.  Seeing as loading the texture is a
one time penalty then openGL really ought to be faster in the long run

On Apr 16, 2:42 am, Frederic frede...@mayot.net wrote:
 I'm in the following situation: I have a large bitmap (~1280x1024)
 that I'd like to display on screen, scaled down in a view that fits
 the phone's screen (~480x320). This bitmap is frequently updated
 (couple of tiles per frame at 15 FPS). I first wanted to implement the
 rendering with a SurfaceView but figured out that all the scaling
 would be done in software due to limitations in the Android SDK. The
 second solution would be to load and render textures in an OpenGL
 context. Would that accelerate the resizing? If yes, isn't the cost of
 loading textures going to offset what I'll win on the scaling side?

 Any toughts?

 Thanks a lot,
 Frederic

 --
 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: Is there a concept like DLL in Androids?

2010-04-17 Thread Bob Kerns
You suggestion (of which I was aware) only handles some of the issues.
I was including your technique under the heading of downloading a
separate .apk.

However, in the current world, it's a valuable technique, and I should
have covered its limitations a bit more explicitly.

Let's say I have a paid core app.

Let's say you have an extension for my app.

The user downloads your app, and pays for it. Then, a day later, he
gets around to trying it. Now your app takes him back to the
marketplace. More money? No. You didn't tell me that, that's not
right!  (Maybe you DID tell him; maybe you didn't have room to explain
it well enough -- and it ate into the space needed to explain YOUR
app).

So now he uninstalls your app. And can't get his money back, and
leaves all sorts of negative comments. So now you're both screwed.

This is a problem even for free apps. If the transaction gets split
up, it won't be successful a lot of the time. Users will be annoyed.
There's not space in the market descriptions to explain what's going
on at time of download. By the time they actually download, there can
be version skew.

Later, he uninstalls the service app, not realizing it's needed. Now
your app breaks. Let's say you start a service on bootup or some other
broadcast intent. Just when do you report that your app is broken?
Sure, the fix is to re-download the service app, but the only time
it's really reasonable to do that is on launching an activity.

And providing .apks for download that don't actually have a launcher
icon, or that don't actually provide any user functionality, presents
its own set of problems.

Your approach primarily is a way of easing the user into the manual
step. I see the very existence of that manual step at that point in
the process as being a major problem.

I've only encountered your technique being used once. It actually
rather startled me -- I've encountered quite a number of cases where
it SHOULD be used. This argues that the mere existence of your
technique isn't sufficient to solve the problem. The problem is, it
requires too much of the programmer, to discover and implement.  This
is really something that should be a documented part of the SDK, in
whatever form it takes. This would help ensure a consistent user
experience and more consistent implementation.

Even if it's just your technique, adopting it as part of the SDK would
help. But as I outlined above, it's an inadequate workaround.

On Apr 17, 4:16 am, Mark Murphy mmur...@commonsware.com wrote:
 Bob Kerns wrote:
  If I have a service used by
  several applications, I currently have to supply it in every
  application, and arrange to negotiate just which one actually provides
  the service.

 That's not the only option -- see below.

  The alternative, of a separate APK is prohibitive because it depends
  on the user seeing the dependency, understanding what to do about it,
  and taking action.

 Those three steps can be handled by the application that has the dependency.

 If your application requires other capabilities:

 -- use PackageManager to see if the required component is there

 -- if not, pop up a dialog saying that you need to download/install the
 dependency before you can continue (or before certain features are enabled)

 -- start up the relevant Market Uri, or download and kick off the
 installation yourself, depending on how the component is distributed

  However, if we could declare in our manifest that a package *requires*
  package, and the Market handled this, most of our problems would be
  solved.

 It would certainly solve all of the above problems, and related ones
 (e.g., uninstalling no-longer-needed applications once whatever depended
 on them is uninstalled, warning a user if they try to uninstall
 something that somebody else depends upon). I suspect it will introduce
 new and exciting problems, but that remains to be seen.

 FWIW, I suggested this about a year ago and the notion was squashed.

 --
 Mark Murphy (a Commons 
 Guy)http://commonsware.com|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 
 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: Why doesn't inPurgeable work with BitmapFactory.decodeFile?

2010-04-17 Thread Nilz
My apologies to anyone who had spent a significant amount of time
looking into this. The inPurgeable option does indeed work for bitmaps
read in using the BitmapFactory.decodeFile method.

The problem I was having was down to the fact that any bitmap that is
used to back a canvas cannot be recycled unless you make the canvas
equal to null first.

Canvas mCanvas;
Bitmap mBitmap;
private example()
{
mBitmap = Bitmap.createBitmap(width, height, Config.ARGB_);
mCanvas = new Canvas(mBitmap);
...
//draw something to the canvas
...
mBitmap.recycle(); //THIS DOESN'T WORK
}

Doing this will not recover the memory used by mBitmap, unless you do
mCanvas = null before it.

Is this a bug???

On 17 Apr, 00:01, Nilz nilz.v.pa...@gmail.com wrote:
 Hi,

 Can anyone explain why when I load images from files using
 BitmapFactory.decodeFile and passing in a BitmapFactory.Options 
 withinPurgeableset to true, I still get OutOfMemoryError?

 For example, doing the following many times, with lots of different
 resources works fine:

 BitmapFactory.Options opts = new Options()
 opts.inPurgeable= true;
 bitmap = BitmapFactory.decodeResource(resources, resId, opts);

 However, doing the following causes an OutOfMemoryError

 BitmapFactory.Options opts = new Options()
 opts.inPurgeable= true;
 bitmap = BitmapFactory.decodeFile(myFile, opts);

 In reality my code isn't as simple as outlined above. What I'm really
 trying to do is load a couple of bitmap resources draw them on a
 bitmap backed canvas, and then write this new bitmap to file, just so
 it can then be finally re-read into memory with theinPurgeableoption
 set to true (using BitmapFactory.decodeFile).

 --
 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: Avoid restarting http request on orientation change

2010-04-17 Thread Bob Kerns
If this were a matter of saving the data, then onPause() is indeed the
place to do the work. However, it's not appropriate here.

This is not something you want to pause. You increase the chances of
connection failure, and you consume resources on the server. Don't do
that.

You also don't want to stop it there, and restart it on resume.  That
just causes extra work, and minimizes your chance of success.

onDestroy() is the right place to actually destroy the background
activity here, if you want it to continue while the activity continues
to be active. Yes, in some circumstances onDestroy() won't be
called, and the process will just be deleted. That will also nuke the
service, though, so that doesn't present a problem.

On Apr 17, 11:02 am, Dimitris dnkou...@gmail.com wrote:
 I would take into consideration that onDestroy() might not get called
 always. Usually onPause() is the best place to store/cache data before
 you are done because it is guaranteed to get called. Keep in mind not
 to do expensive or time consuming operations onPause() because the
 other activity that is trying to show won't show until your onPause()
 is done.

 I recommend reading the Android activity life cycle docs on the
 android dev docs.

 Enjoy :)

 On Apr 17, 3:45 am, patbenatar patbena...@gmail.com wrote:





  Awesome. Thanks Bob! This has been very informative. I will pursue
  this route :)

  On Apr 16, 11:47 pm, Bob Kerns r...@acm.org wrote:

   You are 100% on the right track; this calls for a service.

   As for what happens when your activity is no longer running -- well,
   let's consider that.

   First, if your activity is simply no longer the current activity --
   the user may have pressed Home, for example -- he may switch back to
   it. You'd like to have actually made some progress in the meantime --
   especially if he left because he was tired of waiting for the
   transfer. You probably want to let the transfer continue until
   onDestroy() is called on your Activity, at which point you can stop
   the service.

   If your activity is truly gone -- well, would that information be
   useful if he started up your program again later? If so, you might
   want to consider allowing the transfer to finish, and caching the
   result. In this model, the activity's onDestroy() method leaves the
   service alone, and the service calls stopSelf() when it's done. Next
   time it's started for this purpose, it can check for the cached data
   and immediately supply that.

   If caching is inappropriate, and you want it to only run when the
   Activity is still alive, then use bindServce() instead of
   startService(), and  unbind the service in the Activity's onDestroy().
   The Service can track how many bindings are active, and exit early out
   of its loop reading the data. You couldn't do any better than this at
   stopping the activity even if you were doing it in the Activity
   anyway.

   On Apr 16, 9:57 pm, patbenatar patbena...@gmail.com wrote:

Hey all-

I've run into an interesting little issue.. My loader Activity fetches
data from a web API, starting an http request and waiting for the
result.. Now what if the user flips their phone mid-http request? The
Activity is destroyed and restarted, thus the http request restarts as
well. The fact that my Activity is being destroyed on orientation
change is all good by me, I understand the way Android works, I'm just
looking for a solution to avoid restarting the http request on every
orientation change..

I'm thinking the solution would be Services... I could run a Service
in the background to do the http request and when it finishes, call
back to my Activity and let it handle the data and finish up. The one
thing I'm a bit weirded out about is what if the user closes my app
before the Service's http request finishes? What will it do with the
data if the Activity that needs it is no longer running?

Thoughts, feedback, ideas, etc would be great!

Thanks,
Nick

--
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 
   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] Re: Morphing TextView background images?

2010-04-17 Thread Juan
I'm glad I could help!

Juan


On Apr 16, 8:44 pm, HippoMan hippo.mail...@gmail.com wrote:
 I just tried your suggestion using two TextViews within a FrameLayout.
 It works perfectly, so I don't have to worry about manually wrapping
 text within an ImageView.

 Here's the logic:

 In my onOptionsItemSelected() method, after a menu click:

 * TextView 1 is currently in the front
 * Put a new background image and some new text in TextView 2
 * Switch TextView 1 and TextView 2 (I keep a reference to the
 current and previous TextViews, and I switch those references).
 * Start fading out the new TextView 2
 * Start fading in the new TextView 1
 * Bring the new TextView 1 to the front.
 * Return from onOptionsItemSelected().

 Thanks again for your excellent suggestion!

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


Re: [android-developers] Re: Selling outside the Android Market-- Use Google Checkout to sell direct from website??? SlideMe.Org??

2010-04-17 Thread Shane Isbell
Hi Martin,

SlideME LLC is a Washington State based company so you have some avenues you
can pursue. It appears you've tried to directly resolve the issue with
SlideME but have been unsuccessful.  The Better Business Bureau can assist
you in getting such issues resolved.

https://odr.bbb.org/odrweb/public/cibrbusiness.aspx?e=4661378id=0927e2ab-0046-4101-9482-3ef0436b177csite=114

For some reason, the BBB is still listing me as the principal contact for
SlideME, so you do choose to report the issue, let them know that the
current contact is '*George Christopoulos'  *SlideME's phone number is not
listed on the BBB site, so it can be found here: http://slideme.org/contact

Hope this helps,
Shane

On Fri, Apr 16, 2010 at 12:36 AM, mot12 martin.hu...@gmail.com wrote:

 I would not trust SlideMe.

 For my best selling app, I had 10,000 sales through Google Market,
 900 sales via PayPal and 20 sales via SlideMe. So I stopped my sales
 on SlideMe and asked for a payout. They told me they only do payouts 
 $100. I asked if this was a scam since the vast majority of developers
 don't even reach that figure with them. So one guy from SlideMe sent
 me an email that he was shocked I suggested fraud and that he would
 of course give me my payout. I apologized and gave him by banking
 information and invoice. Never heard from him again. Emails to
 customer service have been unanswered.

 --
 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: getting rid of “warning: unmappable character for encoding ascii”

2010-04-17 Thread Bob Kerns
BTW, I didn't intend to write nobody is going to help you, I meant
to write nobody is going to BE ABLE TO help you. Sorry for the shift
in tone there.

Ant is a tool that invokes other tools. Your error is not coming from
ant, so you need to provide the relevant information for us to be able
to help.

What you cite below is exactly what was missing from your first
message, and makes it easy to help you.

Your problem is with the java compiler, javvac. (That's from the
[javac] at the start of the fline). It is telling you that the problem
it is having is with the file Stuff.java, on line 23.

I presume the file itself is fine. It tells you that it is trying to
understand it as ascii, however. My point wasn't just that the files
should be in UTF-8, but that ALL the TOOLS need to use UTF-8 as well.
Ant will by default, but you're using more than just ant.

In this case, javac is using ascii by default -- so you should tell it
what encoding you're using.

The Ant manual is at http://ant.apache.org/manual/; you can navigate
from there to find the javac task. There, you'll find it takes an
encoding= attribute, so supplying encoding='utf-8' should fix your
problem!

On Apr 17, 3:27 am, Lo'oris loo...@gmail.com wrote:
 On Apr 15, 11:42 pm, Bob Kerns r...@acm.org wrote:

  I'm afraid that nobody is going to help you, because you don't give
  enough context to indicate just what tool is giving this message.

 I don't understand, I told I got this message compiling with ant (ant
 debug, ant release, etc.)

 I'm editing with TextMate (OSX 10.5) and I *did* save the files as
 UTF-8.

     [javac] Compiling 12 source files to /Users/looris/Sviluppo/
 android/projects/toutry/bin/classes
     [javac] /Users/looris/Sviluppo/android/projects/toutry/src/net/
 looris/toutry/Stuff.java:23: warning: unmappable character for
 encoding ascii
     [javac]             return (poked=false); // NOTA: è
 un'assegnazione, non un controllo!
     [javac]                                                ^

 --
 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: Using ResolverActivity as a activity-alias

2010-04-17 Thread Streets Of Boston
Bumped it a little... ;)

On Apr 14, 9:49 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 Due to bughttp://code.google.com/p/android/issues/detail?id=6579is
 it safe to put this into my AndroidManifest.xml file?:

   !-- Below is a workaround due to the Market 
 bughttp://code.google.com/p/android/issues/detail?id=6579--
   activity-alias
 android:name=com.android.internal.app.ResolverActivity
     android:targetActivity=.PickImages android:exported=true/

 The ResolverActivity is a private class and i'm very hesitant to use
 it. However, my app defines two activities with action=MAIN and
 category=LAUNCHER and because of bug 6579, the Market-app crashes when
 'Open' is selected.

 I already have one known negative comment about this (although it's
 not my app that crashes) and I try to avoid any more of these ;-)

 Question is:
 Can i use ResolverActivity (in this way)?

 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] Landscape / Portrait Orientation Pending Intent?

2010-04-17 Thread Adam Brookman
We have created an AppWidget that takes user inputted text into an
EditText and displays a calculated amount of text inside a TextView on
the Home Screen. We calculate the amount of text based on the
AppWidgetInfo.minWidth, minHeight attributes. We do this to simulate
scrolling; we cut up the user-inputted text into chunks that will fit
into the widget and swap them based on button clicks.

When we save the widget with the device in Landscape mode, it
calculates the appropriate amount of text for Landscape mode and
displays it in the widget. The problem is when the user changes
orientation of the device to Portrait mode (without opening the widget
and resaving the text), the calculated amount of text for Landscape
mode is still displayed. This also happens in the vice versa case (the
user is in Portrait and saves, etc.)

How can we tell our AppWidget to recalculate the amount of text
displayed on screen orientation change? Is this possible? How would
you solve this problem?

-- 
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: CheckedTextView tutorial

2010-04-17 Thread raqz
I used the tutorial and was able to display the list. But as you said

To get the selections you would use isItemChecked() on ListView.

I need to hardcode the options to check as to whether it was selected
or not. This is cumbersome if its a large list.
I checked out the various other functions such as
listView.getCheckItemIds(); which returns a long array with ids.
How would I be able to insert a button field in that layout such that,
once the user is done selecting what ever he wishes to, he could just
click the button which could send the array of captured item ids to
another activity for processing.

On Apr 17, 5:21 pm, raqz abdulraqee...@gmail.com wrote:
 Thats great! Thanks.. I was not able to view 
 yourhttp://github.com/commonsguy/cw-andtutorials/tree/master/20-Notificat...
 but I am looking into the other link that you provided.

 Thanks

 On Apr 17, 5:09 pm, Mark Murphy mmur...@commonsware.com wrote:



  raqz wrote:
   Hi,
   I need to display contents of a list of objects. Capture the selected
   items and later process it. I have been trying to find a tutorial on
   net but in vain.
   Could some one please advise me when can I find a tutorial.
   I know how to display a list but I want the CheckedTextView option.

  I use CHOICE_MODE_MULTIPLE in this tutorial from one of my books:

 http://github.com/commonsguy/cw-andtutorials/tree/master/20-Notificat...

  However, that is a bit involved, as it's halfway through the book.

  You can see CHOICE_MODE_MULTIPLE in use here:

 http://developer.android.com/resources/samples/ApiDemos/src/com/examp...

  To get the selections you would use isItemChecked() on ListView.

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


Re: [android-developers] Re: What's wrong with this location code?

2010-04-17 Thread Michael Thomas

patbenatar wrote:

You really have no reason to have a LocationListener[10] array...
There are really only two location providers, Network and GPS. So all
you need are two LocationListeners: fineLocationListener and
coarseLocationListener.
  

Perhaps you are forgetting about the chain and theodolite provider.

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
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] Activity background processing

2010-04-17 Thread skyhigh
I was reading the Android Application Fundamentals page located at
http://developer.android.com/guide/topics/fundamentals.html#actlife
and found this interesting information in the Multitasking section:

Note that when you write an activity, you can make it stop or
continue running when it is moved to the background (see onStop() in
Activity Lifecycle). For activities that download data from the
network, it's recommended to let them continue downloading so the user
can multi-task.

As far as I was aware I had to create a service if I wanted to have a
background activity such as a media player, internet download, or
processing of data in files on the SD card continue when the activity
was no longer in the foreground.

I went and reread the onStop information on the Activity Lifecycle
page, which was referred to.  But I didn't find any mention of how an
activity might continue to run in the background after onStop was
called.

The Activity and Task Design Guidelines page at
http://developer.android.com/guide/practices/ui_guidelines/activity_task_design.html
also mentions something similar when it says:

In addition, not all activities have the behavior that they are
destroyed when BACK is pressed. When the user starts playing music in
the Music application and then presses BACK, the application overrides
the normal back behavior, preventing the player activity from being
destroyed, and continues playing music, even though its activity is no
longer visible — as a visual substitute, the Music application places
a notification in the status bar so the user still has an easy way to
get to the application to stop or control the music. Note that you can
write an activity to stop when its screen is no longer visible, or to
continue running in the background — the latter was chosen for the
music player.

Is the information on these pages accurate?  Is there some mechanism
that I have missed to keep an activity running while it is in the
background?

I have been re-reading all this documentation because I currently use
services to perform these types of background functions, and I have a
cooresponding activity screen from which the user started the
background processing and where the user can see the progress and
status of the background service activity.

When the service has finished I need the user to be able to return to
the activity where they started the background activity.  I currently
have the service use a notification with an intent to start the
activity, but that requires that the notification intent for the
activity have the FLAG_ACTIVITY_NEW_TASK flag and ends up creating
another instance of the activity rather than returning to the one that
is already waiting in the background.  This has the additional problem
that the new instance is on a new task and so the back button and/or
calling Activity.finish() does not return back to the activity the
user came from prior to starting the activity that initiated the
background processing.

If the user stays on my activity screen while the background service
processing is running everything works fine.  But if they press the
home key and do some other tasks, getting back to the correct activity
stack from the service notification icon is the area where I am not
understanding how to bring that existing activity stack back to the
foreground.

As far as I can tell the only way to prevent the service notification
intent from creating a new instance of the activity is to set the
activity launchMode to singleInstance.  However that requires the
activity to be the root of a task and so prevents it from being part
of an activity stack.  In my case this activity can be reached from
more than one activity, and I need the activity stack to function
correctly so it will return back to the right place.

Any help from those that better understand how to get back to an
activity and its activity stack from a service would be greatly
appreciated.

-- 
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] Activity background processing

2010-04-17 Thread Mark Murphy
skyhigh wrote:
 Note that when you write an activity, you can make it stop or
 continue running when it is moved to the background (see onStop() in
 Activity Lifecycle). For activities that download data from the
 network, it's recommended to let them continue downloading so the user
 can multi-task.
 
 As far as I was aware I had to create a service if I wanted to have a
 background activity such as a media player, internet download, or
 processing of data in files on the SD card continue when the activity
 was no longer in the foreground.
 
 I went and reread the onStop information on the Activity Lifecycle
 page, which was referred to.  But I didn't find any mention of how an
 activity might continue to run in the background after onStop was
 called.

Let's ignore activities, services, and the like for a moment.

Your Android application, at its core, is an instance of a Dalvik VM,
inside a process, with a thread and a message queue.

The thread blocks on that queue, pops off a message if there is one
there, and takes action based on that message (called dispatching back
in the bygone era of Win16 programming).

Some of those messages will cause an activity to be created (e.g., an
activity Intent for your activity is received). Some of those messages
will call callbacks into your code (e.g., onCreate() of an activity,
onCreate() of a service, onClick() of a View.OnClickListener).

As components like activities and services get destroyed, they are
(hopefully) garbage collected and no events pertaining to them will ever
get onto the queue. When there are no more components running, Android
can shut down the rest of the application scaffolding and mothball the
process/VM for later reuse.

This, however, only deals with the main application thread. You can have
other threads, that you fork yourself or that are forked for you (e.g.,
AsyncTask thread pool). Those threads do not have a message queue
(unless you heave a Looper at 'em) and can do whatever you want.

So, is there a case where an activity might continue to run in the
background after onStop was called? That depends on how you define
run and activity. Your own threads will continue to run after
onStop() is called. If you wish to consider those threads as being part
of some activity, so be it. The main application thread will not be
calling into your activity while it is stopped.

Personally, I prefer to have my threads either be totally fire and
forget with an AsyncTask, or else be managed by a Service, because of
all the joys from dealing with activities coming and going (e.g., screen
rotation). But, that's just me.

 In addition, not all activities have the behavior that they are
 destroyed when BACK is pressed. When the user starts playing music in
 the Music application and then presses BACK, the application overrides
 the normal back behavior, preventing the player activity from being
 destroyed, and continues playing music, even though its activity is no
 longer visible — as a visual substitute, the Music application places
 a notification in the status bar so the user still has an easy way to
 get to the application to stop or control the music. Note that you can
 write an activity to stop when its screen is no longer visible, or to
 continue running in the background — the latter was chosen for the
 music player.
 
 Is the information on these pages accurate?

Looking at the code, it would appear they use a service.

 If the user stays on my activity screen while the background service
 processing is running everything works fine.  But if they press the
 home key and do some other tasks, getting back to the correct activity
 stack from the service notification icon is the area where I am not
 understanding how to bring that existing activity stack back to the
 foreground.

Off the cuff, I am not certain that is possible.

 As far as I can tell the only way to prevent the service notification
 intent from creating a new instance of the activity is to set the
 activity launchMode to singleInstance.  However that requires the
 activity to be the root of a task and so prevents it from being part
 of an activity stack.  In my case this activity can be reached from
 more than one activity, and I need the activity stack to function
 correctly so it will return back to the right place.

FWIW, the music player (MediaPlaybackService) uses an Intent with the
Intent.FLAG_ACTIVITY_CLEAR_TOP flag. I'm not sure that will help you,
but I figured I'd mention it, since I'm looking at that code now.

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

Android App Developer Books: http://commonsware.com/books

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

[android-developers] ListActivity issue

2010-04-17 Thread raqz
Hi,
I am to display the list and store the selected items in an array. But
I am not able to get the correct items that were selected.
Here whenever the user clicks an item, the array is getting updated,
irrespective if the user is clicking the item to select it or deselect
it. Could some one please help me solve this. I could actually perform
an iteration to remove the odd numbered items in the array but I feel
that would become an overload on the phone. Is there something for
efficient. Please advise.


public class MainActivity extends ListActivity {
TextView selection;
String[] items={sodium, O2, C02, HCL, NaCl,
H2So4, O3, Ag};
String names[] = new String[10];
static int i=0; int posarray[] = new int[10];
@Override
public void onCreate(Bundle icicle)
   {
super.onCreate(icicle);
setContentView(R.layout.main);
setListAdapter(new ArrayAdapterString(this,

android.R.layout.simple_list_item_multiple_choice,

items));
ListView listView = getListView();
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
selection=(TextView)findViewById(R.id.selection);
}

public void onListItemClick(ListView parent, View v, int position,

long id)
{
posarray[i]=position;

if(!check(position))
{
names[i]= items[position];
}
selection.setText(arrayToString(names));i++;


}

private boolean check(int position) {
for(int k=0;kposarray.length;k++){
if(posarray[k]==position)
{
posarray[k]=100;
return true;
}

}
return false;

}

public String arrayToString(String[] stringarray){
String str =  ;
for (int i = 0; i  stringarray.length; i++) {
  str = str + stringarray[i];
}
return str;
  }
}







Thanks,
Raqeeb

-- 
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] ListActivity issue

2010-04-17 Thread Mark Murphy
raqz wrote:
 Here whenever the user clicks an item, the array is getting updated,
 irrespective if the user is clicking the item to select it or deselect
 it. 

Don't override onListItemClick(). If you are going to use
ListView.CHOICE_MODE_MULTIPLE, then use getCheckedItemPositions() to
determine which items were checked.

http://stackoverflow.com/questions/1342073/android-selected-positions-in-a-listview

If you were using a CursorAdapter, you could use getCheckedItemIds()
instead, but an ArrayAdapter doesn't have IDs, only positions.

-- 
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: What's wrong with this location code?

2010-04-17 Thread patbenatar
 Perhaps you are forgetting about the chain and theodolite provider.

Mike-

What are those? The LocationManager class only has these two provider
constants: GPS_PROVIDER, NETWORK_PROVIDER.

Thanks!
Nick




On Apr 17, 2:57 am, Michael Thomas enervat...@gmail.com wrote:
 patbenatar wrote:
  You really have no reason to have a LocationListener[10] array...
  There are really only two location providers, Network and GPS. So all
  you need are two LocationListeners: fineLocationListener and
  coarseLocationListener.

 Perhaps you are forgetting about the chain and theodolite provider.

 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
 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: Avoid restarting http request on orientation change

2010-04-17 Thread patbenatar
Agreed, Bob. I will pursue your above route :)

Dimitris- Thanks for the input. I have read the Activity lifecycle
docs and believe I have a pretty solid understanding of the Activity
lifecycle, this issue is however more related to the Service
lifecycle.


On Apr 17, 2:53 pm, Bob Kerns r...@acm.org wrote:
 If this were a matter of saving the data, then onPause() is indeed the
 place to do the work. However, it's not appropriate here.

 This is not something you want to pause. You increase the chances of
 connection failure, and you consume resources on the server. Don't do
 that.

 You also don't want to stop it there, and restart it on resume.  That
 just causes extra work, and minimizes your chance of success.

 onDestroy() is the right place to actually destroy the background
 activity here, if you want it to continue while the activity continues
 to be active. Yes, in some circumstances onDestroy() won't be
 called, and the process will just be deleted. That will also nuke the
 service, though, so that doesn't present a problem.

 On Apr 17, 11:02 am, Dimitris dnkou...@gmail.com wrote:





  I would take into consideration that onDestroy() might not get called
  always. Usually onPause() is the best place to store/cache data before
  you are done because it is guaranteed to get called. Keep in mind not
  to do expensive or time consuming operations onPause() because the
  other activity that is trying to show won't show until your onPause()
  is done.

  I recommend reading the Android activity life cycle docs on the
  android dev docs.

  Enjoy :)

  On Apr 17, 3:45 am, patbenatar patbena...@gmail.com wrote:

   Awesome. Thanks Bob! This has been very informative. I will pursue
   this route :)

   On Apr 16, 11:47 pm, Bob Kerns r...@acm.org wrote:

You are 100% on the right track; this calls for a service.

As for what happens when your activity is no longer running -- well,
let's consider that.

First, if your activity is simply no longer the current activity --
the user may have pressed Home, for example -- he may switch back to
it. You'd like to have actually made some progress in the meantime --
especially if he left because he was tired of waiting for the
transfer. You probably want to let the transfer continue until
onDestroy() is called on your Activity, at which point you can stop
the service.

If your activity is truly gone -- well, would that information be
useful if he started up your program again later? If so, you might
want to consider allowing the transfer to finish, and caching the
result. In this model, the activity's onDestroy() method leaves the
service alone, and the service calls stopSelf() when it's done. Next
time it's started for this purpose, it can check for the cached data
and immediately supply that.

If caching is inappropriate, and you want it to only run when the
Activity is still alive, then use bindServce() instead of
startService(), and  unbind the service in the Activity's onDestroy().
The Service can track how many bindings are active, and exit early out
of its loop reading the data. You couldn't do any better than this at
stopping the activity even if you were doing it in the Activity
anyway.

On Apr 16, 9:57 pm, patbenatar patbena...@gmail.com wrote:

 Hey all-

 I've run into an interesting little issue.. My loader Activity fetches
 data from a web API, starting an http request and waiting for the
 result.. Now what if the user flips their phone mid-http request? The
 Activity is destroyed and restarted, thus the http request restarts as
 well. The fact that my Activity is being destroyed on orientation
 change is all good by me, I understand the way Android works, I'm just
 looking for a solution to avoid restarting the http request on every
 orientation change..

 I'm thinking the solution would be Services... I could run a Service
 in the background to do the http request and when it finishes, call
 back to my Activity and let it handle the data and finish up. The one
 thing I'm a bit weirded out about is what if the user closes my app
 before the Service's http request finishes? What will it do with the
 data if the Activity that needs it is no longer running?

 Thoughts, feedback, ideas, etc would be great!

 Thanks,
 Nick

 --
 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] Re: install .apk file OTA

2010-04-17 Thread patbenatar
Food for thought: If your apk is delivered outside of the Market, the
user will not be prompted for future updates nor will the install
count towards your Total Downloads in the Market--and the user won't
be able to comment on your app in the Market.

-Nick



On Apr 16, 11:45 pm, Rishabh rishabhjainw...@gmail.com wrote:
 Thanks patbenatar,

 I am trying it like this.

 On Apr 17, 11:31 am, patbenatar patbena...@gmail.com wrote:





  Put it up on a webserver then go tohttp://www.yourserver.com/yourpackage.apk
  and the file will be downloaded to your phone--delivering the apk
  OTA.. The Browser will recognize it as an apk file and if the user
  has Allow Non-Market Apps enabled, the user will be prompted for an
  install.

  I've never done this but from reading other topics on this group, this
  is my understanding.

  On Apr 15, 9:49 pm, Rishabh rishabhjainw...@gmail.com wrote:

   Hi,

   I have an android's .apk signed file , how can I install it OTA on my
   Android 2.1 device.

   Thanks
   Rishabh

   --
   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 
  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 
 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] Hiding the virtual keyborad in a ListActivity

2010-04-17 Thread praj
Hi,

I was trying to disable the keyboard on my ListActivity but it does
not work, however the same code works in a normal activity. Is there
anything that i am missing.

I have tried the following :
1)
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

2)  EditText search_s = (EditText) findViewById(R.id.search_txt);
InputMethodManager imm =
(InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(search_s.getWindowToken(), 0);

Is there anything that I need to do if it is a ListActivity or is it
the same?

Please can anyone let me know about this.

Thanks,
Prajakta

-- 
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: Selling outside the Android Market-- Use Google Checkout to sell direct from website??? SlideMe.Org??

2010-04-17 Thread George | SlideME
Shane,

You are not aware in any way of the conversation between Martin and SlideME
(since you were not with SlideME) or maybe where Martin missed what he
actually needed to do that was clear in the first email to him, that he
unfortunately did not follow.  I am sure your interests since you departed
SlideME is to damage SlideME's image as best you can for whatever personal
reasons you may have.

You also failed to mention for the three developers you posted that had
problems receiving a payout, that they were in contact with you during that
time and you failed to respond in many emails from them. Fortunately I had
means to keep in contact and remitted payouts to them from accounts you did
not control. Many support issues also had to be resolved by phone contact
since you lacked to follow up. So I would appreciate to not use your wrong
doings whilst at SlideME against what SlideME is building today with great
success.

Anyway, thanks for pointing out the BBB, as it needs to be fixed and handy
for developers to know as they venture into the business world of who to
trust and not to trust.  Don't know why you pointed it out though, when
SlideME's interest is to grow and support developers at best we can with our
resources. It would not make sense for what we are pursuing if we did wrong
against developers.

Shane you may also want to check your Mikandi terms against
http://www.copyscape.com, as it appears to be a clone of Android's Market.
Guess, you shouldn't put your new partners in such a responsible state.



re: Martin follow up issue.

Helped Martin format his invoice and what he needs to include:

Invoice to:  SlideME LLC  (that he missed)
Address: companies address (also that he missed)
Invoice #:


A simple explanation of what should be included in an invoice can be found
here: http://www.ir35calc.co.uk/how_to_prepare_an_invoice.aspx


We have helped Martin format his invoice as we have helped many other
developers, but as anyone can understand, we need to conduct business a
certain way and we are not able to take all developers by the hand if they
do not submit as we require such paperwork. I am sure many other developers
are aware of how much more complex applications are for other stores,
including Apple's AppStore, RIM's AppWorld, or even MS WinMo's Marketplace
and doubt they will put in the effort as I have on a personal level to
assist them, with our limited resources.

I am more than happy for Martin to confirm if such details were mentioned to
him in the initial lengthy explanatory email to him, and additionally invite
even more developers to have their say.

Wish to also say thank you to Paul for uploading his application to SlideME,
considering the negativity of this thread from an ex-partner. I am sure Paul
and many others will be well looked after as best as we can and have their
say one day.

Thanks,
George



Hi Martin,

 SlideME LLC is a Washington State based company so you have some avenues
 you can pursue. It appears you've tried to directly resolve the issue with
 SlideME but have been unsuccessful.  The Better Business Bureau can assist
 you in getting such issues resolved.


 https://odr.bbb.org/odrweb/public/cibrbusiness.aspx?e=4661378id=0927e2ab-0046-4101-9482-3ef0436b177csite=114

 For some reason, the BBB is still listing me as the principal contact for
 SlideME, so you do choose to report the issue, let them know that the
 current contact is '*George Christopoulos'  *SlideME's phone number is not
 listed on the BBB site, so it can be found here:
 http://slideme.org/contact

 Hope this helps,
 Shane

 On Fri, Apr 16, 2010 at 12:36 AM, mot12 martin.hu...@gmail.com wrote:

 I would not trust SlideMe.

 For my best selling app, I had 10,000 sales through Google Market,
 900 sales via PayPal and 20 sales via SlideMe. So I stopped my sales
 on SlideMe and asked for a payout. They told me they only do payouts 
 $100. I asked if this was a scam since the vast majority of developers
 don't even reach that figure with them. So one guy from SlideMe sent
 me an email that he was shocked I suggested fraud and that he would
 of course give me my payout. I apologized and gave him by banking
 information and invoice. Never heard from him again. Emails to
 customer service have been unanswered.

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

Re: [android-developers] Re: Selling outside the Android Market-- Use Google Checkout to sell direct from website??? SlideMe.Org??

2010-04-17 Thread Shane Isbell
On Sat, Apr 17, 2010 at 7:57 PM, George | SlideME
george.slid...@gmail.comwrote:

 Shane,

 You are not aware in any way of the conversation between Martin and SlideME
 (since you were not with SlideME) or maybe where Martin missed what he
 actually needed to do that was clear in the first email to him, that he
 unfortunately did not follow.  I am sure your interests since you departed
 SlideME is to damage SlideME's image as best you can for whatever personal
 reasons you may have.

Ad hominem's are a sign of a weak argument. I'm keeping all my points on
target. If you are paying out to developers then you should be fine and
dandy. As I clearly stated, I don't know the general situation but what
developers like Martin and Koxx are saying is that SlideME hasn't in their
case. You say you are now dealing with it. Well great!

You aren't sure of anything, at least not where it touches reality. My
personal reasons are not to damage SlideME's image but to keep SlideME
honest with the developer community.


 You also failed to mention for the three developers you posted that had
 problems receiving a payout, that they were in contact with you during that
 time and you failed to respond in many emails from them. Fortunately I had
 means to keep in contact and remitted payouts to them from accounts you did
 not control. Many support issues also had to be resolved by phone contact
 since you lacked to follow up. So I would appreciate to not use your wrong
 doings whilst at SlideME against what SlideME is building today with great
 success.

I don't think you even want to go there. I'm keeping everything confidential
and I take that very seriously. Apparently, you aren't. So don't force me to
reveal such matters to defend myself (like in regards to what happened to
our mail-servers, personal e-mail accounts, and domain names last
October/November), just correct your distortions of what went on internally.




 Anyway, thanks for pointing out the BBB, as it needs to be fixed and handy
 for developers to know as they venture into the business world of who to
 trust and not to trust.  Don't know why you pointed it out though,

I pointed it out because some developers are saying SlideME is ignoring
their e-mails and not fulfilling promises of payment. Any active member of
the community would likely do the same.  I'm not sure how it is in Greece,
but in the US agencies like the BBB help resolve issues between customers
and business in a professional way, they aren't just a reporting agency.
There is absolutely nothing wrong with customers using them as a mediator
when they can't get resolution (even with honest companies).


 when SlideME's interest is to grow and support developers at best we can
 with our resources. It would not make sense for what we are pursuing if we
 did wrong against developers.

 Shane you may also want to check your Mikandi terms against
 http://www.copyscape.com, as it appears to be a clone of Android's Market.
 Guess, you shouldn't put your new partners in such a responsible state.




 re: Martin follow up issue.

 Helped Martin format his invoice and what he needs to include:

 Invoice to:  SlideME LLC  (that he missed)
 Address: companies address (also that he missed)
 Invoice #:
 

 A simple explanation of what should be included in an invoice can be found
 here: http://www.ir35calc.co.uk/how_to_prepare_an_invoice.aspx


 We have helped Martin format his invoice as we have helped many other
 developers, but as anyone can understand, we need to conduct business a
 certain way and we are not able to take all developers by the hand if they
 do not submit as we require such paperwork. I am sure many other developers
 are aware of how much more complex applications are for other stores,
 including Apple's AppStore, RIM's AppWorld, or even MS WinMo's Marketplace
 and doubt they will put in the effort as I have on a personal level to
 assist them, with our limited resources.

 I am more than happy for Martin to confirm if such details were mentioned
 to him in the initial lengthy explanatory email to him, and additionally
 invite even more developers to have their say.

 Wish to also say thank you to Paul for uploading his application to
 SlideME, considering the negativity of this thread from an ex-partner. I am
 sure Paul and many others will be well looked after as best as we can and
 have their say one day.

 Thanks,
 George



 Hi Martin,

 SlideME LLC is a Washington State based company so you have some avenues
 you can pursue. It appears you've tried to directly resolve the issue with
 SlideME but have been unsuccessful.  The Better Business Bureau can assist
 you in getting such issues resolved.


 https://odr.bbb.org/odrweb/public/cibrbusiness.aspx?e=4661378id=0927e2ab-0046-4101-9482-3ef0436b177csite=114

 For some reason, the BBB is still listing me as the principal contact for
 SlideME, so you do choose to report the issue, let them know that the
 current contact is '*George 

[android-developers] Setting the text in the dialog for an EditTextPreference

2010-04-17 Thread Hayden
I have a Preference Activity setup for my app, and am having a problem
with the EditTextPreference type.  Is there a way to set the text that
is displayed within the text field in the popup dialog? I am able to
set up to it's initial default value, but once a user changes it at
least once, it always remains the last value the user input.  The
reason I want this functionality is that I have a Reset to Defaults
button in my settings, and even after the defaults are reset, the
value that's in the dialog is always the value the user last input.

I've tried both of these and they don't work:

myEditTextPreference.setText(value I want to reset it to);
myEditTextPreference.getEditText().setText(value I want to reset it
to);

Is there a way to do this?

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


[android-developers] problem accessing widget in Preference widgetLayout

2010-04-17 Thread hacksoft
Hi,

I can't seem to get a handle to the embedded widget (via widgetLayout)
in my preference.


My Preference XML is:

PreferenceScreen
xmlns:android=http://schemas.android.com/apk/res/android;
android:key=first_preferencescreen

EditTextPreference android:key=displayname
android:title=Display Name
android:summary=Choose a 
display name /


 Preferenceandroid:id=@+id/displayimageview
android:key=displayimagekey
android:title=Display Image
android:summary=Select Display Image
android:widgetLayout=@layout/displayimage
 /

/PreferenceScreen


My widget XML is:

LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=wrap_content
android:layout_height=wrap_content
android:orientation=horizontal


ImageButton android:id=@+id/displayimagebutton
android:layout_width=wrap_content
android:layout_height=wrap_content
android:padding=1dp
/

 /LinearLayout


I'm trying to get a handle on the displayimagebutton to embed an
ImageButton in a preference row.


My java code is:
  View v1 = null;
  v1 = findViewById(R.layout.preferences);
  ImageButton ib = null;
  if (v1 == null)
  Log.d(SUBSYSTEM_TAG, v1 = null);
  else
  {
  ib = (ImageButton)v1.findViewById(R.id.displayimagebutton);
  }

I can't seem to get a view to the preferences I setup in
preferences.xml.  in my OnCreate() I'm calling:
 addPreferencesFromResource(R.layout.preferences);

and this seems to work fine since the preferences layout is
represented on the screen.  However I can't get a View to this layout
as my java code is trying above, so I can find the embedded widget.

I've tried: v1 = findViewById(R.id.displayimageview);
but that just returns null also.

Any ideas on how I can get the ImageButton reference to my
displayimagebutton?

I'm really disappointed on the lack of an Android example for this.

Thanks!

John Roberts

-- 
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: glCopyTexImage2D - Success anyone?

2010-04-17 Thread Andres Colubri
I finally got glCopyTexImage2D t work, using a power-of-two texture as 
you suggested, and GL_RGB as internal format passed to glCopyTexImage2D 
(the internal format of the texture is GL_RGBA).


glCopyTexSubImage2D doesn't seem to work though. As far as I understand 
from reading the OpenGL ES documentation, this call:


glCopyTexSubImage2D(GL10.GL_TEXTURE_2D, 0, 0, 0, 0, 0, w, h);

should be equivalent to:

glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0,0, w, h, 0)

if the internal format of the bound texture is RGB. Am I correct?

Thanks for the feedback.

Robert Green wrote:

Have you tried copying it to a power of 2 texture instead of the
viewport dimensions?  I'd test with 512x256 and see if that works.

On Apr 16, 10:22 pm, Andres Colubri andres.colu...@gmail.com wrote:
  

Any updates on this one? I have been trying to copy the contents of the
back buffer into an opengl texture, but without success. I'm using the
same method mentioned in the first post of this thread:

gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGB, 0,0, w, h, 0);

where w and h are the current width and height of the screen,
respectively. This works fine on the emulator, but it returns garbage
back into the texture on the actual device.
The phone is a Nexus One.

On Dec 11 2009, 11:56 pm, scott19_68 sw.cop...@gmail.com wrote:
  Works for me on my HTC Hero - I too could only use RGB and not RGBA.
  Emulator flips the textures upside down though...
 
  Does anyone else have more information regarding other phones?  I have
  an app on the app store that uses this method and I am suspecting that
  it does not work for all current phones.  I get really useful comments
  like 'Does not work on Tattoo - nuff said'...
 
  Not sure if the forum rules prevent me from mentioning my app so PM me
  if you'd like to help out and test - I'd definitely appreciate it very
  much and would be willing to help you out in return regarding OpenGL
  development questions...
 
  On Nov 21, 4:45 pm, Ben Gotow bengo...@gmail.com wrote:
 
   Hey everyone,
 
   I'm porting anOpenGLapp from the iPhone to Android, and I need to
   renderOpenGLcontent to a texture. Since framebuffers are not
   available inOpenGL1.0 and the DROID is the only Android phone to
   support the framebuffer extension, I'm trying to draw usingOpenGLand
   then copy the result into a texture usingglCopyTexImage2D. However,
   my initial findings are not good:
 
   1.glCopyTexImage2Dworks in the Android emulator (OS v. 1.5), but
   only with GL10.GL_RGB, not GL_RGBA. If you try to copy the alpha data
   from the scene into the texture, you just get a completely white
   texture.
 
   2.glCopyTexImage2Ddoesn't seem to work _at all_ on the Android G1.
   It does not throw an UnsupportedOperationException but after calling
   it, the texture is completely white.
 
   Has anyone successfully usedglCopyTexImage2Don an actual device? If
   so, could you please post a bit of the code you're using? I suspect it
   works only with specific settings, if at all. Right now, I'm calling
   it like this:
 
   gl.glCopyTexImage2D(GL10.GL_TEXTURE_2D, 0, GL11.GL_RGBA, 0,0, 256,
   256, 0);

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