[android-developers] Re: The life cycle of a static

2010-03-08 Thread westmeadboy
Thanks Farproc, that all makes sense.

The documentation here: 
http://developer.android.com/intl/de/resources/faq/framework.html#3

talks about A public static field/method way of passing data to
activities.

But it seems that its important to know that you can't just set that
at the point you call the new activity. Instead it seems you have to
set it every time the VM is (re)created?

If you start Activity2 from Activity1 and the user hits home in
Activity2 and the VM gets killed...then when the user returns to the
app, Activity2 will get recreated, but Activity1 won't, right? If so,
then Activity1 can't be used to set up the static used by Activity2.

Would be really useful if someone could confirm this.

On Mar 8, 7:29 am, Farproc farp...@gmail.com wrote:
  I thought if I set a static field then that will stay set as long as
  the VM is alive.

 I agree with you.

 But you can't make such an assumption that MyActivity.onCreate()
 will be always executed in the same VM process as
 MyActivity.COMPLEX_OBJ = myComplexObj; // which is definitely NOT .
 The first time you launch MyActivity, they are in the same VM
 instance, but after that MyActivity may be paused(as the user press
 home key) and then the VM process may be killed if extra
 resources(memory etc) are need by other applications.
 What will happen if the user long press home and come back to
 MyActivity again? A new VM process will be created,  a new instance of
 MyActivity will be created and resumed! MyActivity.onCreate() will
 be executed in a completely new VM process this time!!

 NOT TESTED AND VERIFIED!

 On Mar 7, 6:12 pm, westmeadboy westmead...@yahoo.co.uk wrote:



  When starting a new Activity, I want to pass a complex object and do
  so by using this approach:

  MyActivity.COMPLEX_OBJ = myComplexObj; // which is definitely NOT
  NULL!
  Intent intent = new Intent();
  intent.setClass(this, MyActivity.class);
  startActivity(intent);

  and then in MyActivity:

  @Override
  public void onCreate(Bundle bundle) {
          if (COMPLEX_OBJ == null) {
                  // report to Flurry
                  ...
          }
          ...

  }

  When I've tested this on my devices, everything works fine.

  However, from Flurry analytics, I see that COMPLEX_OBJ is sometimes
  null! But I've checked my code 100 times and can say it is absolutely
  not possible that COMPLEX_OBJ is being set with a non null value.

  My initial guess was that onCreate() was being called before
  startActivity() - is this possible? BTW, the activity is defined in
  the Manifest without any intent filters.

  Then I found this:

 http://developer.android.com/intl/de/guide/appendix/faq/framework.html#3

  which says:

  But, the life cycle of a static is not well under your control

  I thought if I set a static field then that will stay set as long as
  the VM is alive. Or have a misunderstood something?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 do I get the ScrollView's mTop value (i.e. the height of the status bar)?

2010-03-08 Thread jamesc
I've implemented a square View whose container is a ScrollView (so as
to allow my View to scroll when the IME is shown/hidden).  Because
it's placed in a ScrollView, when my View's onMeasure() is called the
heightMeasureSpec value is 0 (i.e. View.MeasureSpec.UNSPECIFIED + 0).

In portrait, I can set the height of the View based on the full width
of the screen.  In landscape I want the View to be the height of the
screen (i.e. the short length of the screen) minus the status/
notification bar height; how do I get this value (i.e. the
ScrollView's mTop value)?

Cheers

James

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


[android-developers] Re: Problem with ListPreference in preference view

2010-03-08 Thread Kevin S.
  I have the same problem which I have lost about 5 hours on.   I
finally found this:

http://code.google.com/p/android/issues/detail?id=4497

After removing all the text from the Dialog Message xml attribute of
the list preference,  it started working.It was especially
irritating that there was no message in the log that anything was
wrong.

-Kevin


On Jan 17, 8:29 pm, Chris.H mrchi...@gmail.com wrote:
 This is my first Android app (which is a soft keyboard, with dvorak
 layout) and so far it has gone pretty smoothly (either because or
 despite working from the sample code). I've had some problems (with
 special/swedish characters) that I've managed to take care of, but
 this problem I can't figure out how to solve..

 I've added a preferences view to the app for some(/a) settings, I used
 this reference:http://www.old.kaloer.com/android-preferences/and it
 worked pretty well (besides some hick up from launching the activity
 from a service).

 But when I click the list item to edit it, i get an empty dialog
 (Title and button is shown right and with the text I set in the xml-
 file, but no list, screenshot:http://i49.tinypic.com/2501p55.png).
 I can't see any problem with the program code (which isn't many
 lines..) or the xml (the arrays are generated by the Android utils in
 Eclipse and the preferences is a mix of auto and manual). You can see
 both Java code and XML here:http://pastebin.com/m4c52c3a2(titles etc
 in Swedish..)
 (I've also tried a EditTextPreference item, which seemed to work
 fine..)

 I have also looked at the log/output using adb, and can't see any
 problems there either, so I have no idea onto how to solve this...
 So i need some help..

 Regards
 Christopher H

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: MultiScreen Support in Android?

2010-03-08 Thread javame_android
Hi,

I am trying to use Resource Qualifier for layout as layout-large. But
when the application is starting in the emulator its reading the same
file from default layout folder. The res folder structure is as
below :

res/
layout/login.xml
layout-large/login.xml

What I want is when there is large screen the layout-large/login.xml
file should be read but its not.

What is wrong over here?

Any help would be appreciated?


Thanks  Regards
Sunil

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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, SimpleAdapter and Bitmaps - bug ?

2010-03-08 Thread grace
hi,
u cant bind images using simple adapter..
u need to create one custom adapter for that..

here is a simple example of custom adapter..

http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/

now u can try add ur image along with 2 text views to your adapter






On Mar 7, 9:26 pm, Marco Alexander Schmitz
marco.alexander.schm...@googlemail.com wrote:
 Hi,

 I got my ListView which shows one ImageView and two TextViews in every
 row.

 Now I want to load the images NOT from my ressources (as in many
 examples) but from the internet.

 Somehow this doesnt work with the SimpleAdapter. Is this a bug?

 Here comes my code:

 ---

 MEINUNGEN.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 android:background=@drawable/bg

 ListView android:id=@+id/android:list
 android:layout_width=fill_parent
 android:layout_height=fill_parent android:cacheColorHint=#
 android:divider=@drawable/divider android:dividerHeight=1px/

 /LinearLayout

 ---

 MEINUNGEN_LIST_ROW.XML:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
 android:layout_width=fill_parent
 android:layout_height=wrap_content
 android:orientation=horizontal android:paddingTop=3dip
 android:paddingBottom=3dip android:paddingLeft=3dip

 ImageView android:id=@+id/icon android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:layout_gravity=center_vertical
 android:src=@drawable/wolfgangroth /

 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
 android:layout_width=fill_parent android:layout_height=fill_parent
 android:orientation=vertical

 TextView android:id=@+id/name android:text=Thomas Öchsner
 android:textSize=10px android:gravity=center_vertical
 android:paddingLeft=6dip android:paddingTop=6dip
 android:textColor=#cc android:layout_width=fill_parent
 android:layout_height=wrap_content/

 TextView android:id=@+id/content android:text=Dämpfer für von der
 Leyen
 android:textSize=16px android:gravity=center_vertical
 android:paddingLeft=6dip android:paddingTop=6dip
 android:textColor=#ee android:layout_width=fill_parent
 android:layout_height=wrap_content/

 /LinearLayout

 /LinearLayout

 ---

 public class MeinungenListActivity extends ListActivity {

 private static final String ICON = icon;
 private static final String NAME = name;
 private static final String CONTENT = content;
 private static final String INTENT = intent;
 private static final String[] PARAM = { ICON, NAME, CONTENT };

 private ListMapString, Object list = new ArrayListMapString,
 Object();

 public void onCreate(Bundle icicle) {
 super.onCreate(icicle);

 setContentView(R.layout.meinungen);

 addItem(list, R.drawable.thomasoechsner, Thomas Öchsner,
 Dämpfer für von der Leyen, new Intent(this,
 MeinungenListActivity.class));

 addItem(list, R.drawable.marcbeise, Marc Beise,
 Die Banker ducken sich schon wieder weg, new Intent(this,
 MeinungenListActivity.class));

 addItem(list, R.drawable.wolfgangroth, Wolfgang Roth,
 Röttgen setzt auf Angriff, new Intent(this,
 MeinungenListActivity.class));

 addItem(list, R.drawable.charlottefrank, Charlotte Frank,
 Sorge um die Vorsorge, new Intent(this,
 MeinungenListActivity.class));

 SimpleAdapter notes = new SimpleAdapter(this, list,
 R.layout.meinungen_list_row, PARAM, new int[] { R.id.icon, R.id.name,
 R.id.content });
 setListAdapter(notes);

 }

 public void addItem(ListMapString, Object data, int icon, String
 name, String content, Intent intent) {
 MapString, Object map = new HashMapString, Object();
 map.put(ICON, icon);
 map.put(NAME, name);
 map.put(CONTENT, content);
 map.put(INTENT, intent);
 data.add(map);

 }

 ---

 THIS CODE IS THE PROBLEM (please look at here_comes_it):

 public void addItem(ListMapString, Object data, Bitmap
 here_comes_it, String name, String content, Intent intent) {
 MapString, Object map = new HashMapString, Object();
 map.put(ICON, here_comes_it);
 map.put(NAME, name);
 map.put(CONTENT, content);
 map.put(INTENT, intent);
 data.add(map);

 }

 try {
 URL aURL = new URL(http://www.anddev.org/images/avatars/
 6748766294aa15a585d1fd.jpg);
 URLConnection conn = aURL.openConnection();
 conn.connect();
 InputStream is = conn.getInputStream();
 Bitmap here_comes_it = BitmapFactory.decodeStream(is);
 is.close();

 addItem(list, here_comes_it, Daniela Kuhr, Angst vor der
 Genknolle, new Intent(this, MeinungenListActivity.class));} catch (Exception 
 e) {

 e.printStackTrace();

 }

 

[android-developers] Re: MultiScreen Support in Android?

2010-03-08 Thread Yahel
Hi,

Sorry I don't know how you can solve your problem as I've never ran
into it.

But just to point to the obvious and make sure you read :

http://developer.android.com/intl/de/guide/practices/screens_support.html

Good luck.

Yahel

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: setbackgrounddrawable from sd card

2010-03-08 Thread prachi
Hii

Before using the method setBackgroundDrawable() method to set tthe
background of your layout screen which takes Drawable object you need
to first create the drawable object fron the filename using the static
method createFromPath(String pathname) present in Drawable class.In
the pathname specify the location of your image stored in sdcard and
then you can use the method setBackgroundDrawable() to set the
background.

On Mar 6, 11:13 am, BGH bradleygh...@gmail.com wrote:
 I want to set the background of my main layout screen from a file on
 the SD card? Been searching but I cant work out how to achieve 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] Re: Regarding ListView

2010-03-08 Thread grace
u can change it in the layout file..
try changing the height of the list item, according to the content you
are trying to display



On Mar 4, 3:52 pm, vinoth vinothso...@gmail.com wrote:
 How to increase the listview item size? When the text to be displayed
 is longer, it gets clubbed and could not see the full text.

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


[android-developers] Re: Stopped unexpectedly on a real phone but not on the simulator

2010-03-08 Thread Robert Green
Posting a stack trace from your log would be extremely helpful: )

On Mar 8, 1:19 am, CMF manf...@gmail.com wrote:
 Hi all, I have an MapView app downloaded from internet, when I tested
 it on the simulator, everything is fine, but when I installed it on my
 phone, the app stopped unexpectedly. Here is the code

 public class CurrentLocationWithMap extends MapActivity {

     MapView map;

     MapController ctrlMap;
     Button inBtn;
     Button outBtn;
     ToggleButton switchMap;

     @Override
         protected boolean isRouteDisplayed() {
                 return false;
         }

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

         map = (MapView)findViewById(R.id.myMapView);
         ListOverlay overlays = map.getOverlays();
         MyLocationOverlay myLocation = new
 MyLocationOverlay(this,map);
         myLocation.enableMyLocation();
         overlays.add(myLocation);

         ctrlMap = map.getController();
         inBtn = (Button)findViewById(R.id.in);
         outBtn = (Button)findViewById(R.id.out);
         switchMap = (ToggleButton)findViewById(R.id.switchMap);

         OnClickListener listener = new OnClickListener() {
             @Override
             public void onClick(View v) {
                 switch (v.getId()) {
                 case R.id.in:
                     ctrlMap.zoomIn();
                     break;
                 case R.id.out:
                     ctrlMap.zoomOut();
                     break;
                 default:
                     break;
                 }
             }
         };
         inBtn.setOnClickListener(listener);
         outBtn.setOnClickListener(listener);

         //===

         switchMap.setOnCheckedChangeListener(new
 OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton cBtn, boolean
 isChecked) {
                 if (isChecked == true) {
                     map.setSatellite(true);
                 } else {
                     map.setSatellite(false);
                 }
             }
         });

         LocationManager locationManager;
         String context = Context.LOCATION_SERVICE;
         locationManager = (LocationManager)getSystemService(context);
         //String provider = LocationManager.GPS_PROVIDER;

         Criteria criteria = new Criteria();
         criteria.setAccuracy(Criteria.ACCURACY_FINE);
         criteria.setAltitudeRequired(false);
         criteria.setBearingRequired(false);
         criteria.setCostAllowed(true);
         criteria.setPowerRequirement(Criteria.POWER_LOW);
         String provider = locationManager.getBestProvider(criteria,
 true);

         Location location =
 locationManager.getLastKnownLocation(provider);
         updateWithNewLocation(location);
         locationManager.requestLocationUpdates(provider, 2000, 10,
                         locationListener);
     }
    private final LocationListener locationListener = new
 LocationListener() {
         public void onLocationChanged(Location location) {
         updateWithNewLocation(location);
         }
         public void onProviderDisabled(String provider){
         updateWithNewLocation(null);
         }
         public void onProviderEnabled(String provider){ }
         public void onStatusChanged(String provider, int status,
         Bundle extras){ }
     };
     private void updateWithNewLocation(Location location) {
         String latLongString;
         TextView myLocationText;
         myLocationText = (TextView)findViewById(R.id.myLocationText);
         if (location != null) {
             double lat = location.getLatitude();
             double lng = location.getLongitude();
             latLongString = Latitude: + lat + \nLongtitude: + lng;

             ctrlMap.animateTo(new GeoPoint((int)(lat*1E6),(int)
 (lng*1E6)));
         } else {
             latLongString = Position not found;
         }
         myLocationText.setText(Current location:\n +
         latLongString);

     }

 }

 ?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:id=@+id/myLocationText
     android:layout_width=fill_parent
     android:layout_height=wrap_content
     /
 LinearLayout
     android:orientation=horizontal
     android:layout_width=fill_parent
     android:layout_height=wrap_content 
     Button
         android:id=@+id/in
         android:layout_width=fill_parent
         android:layout_height=wrap_content
         android:layout_weight=1
         android:text=Zoom in /
     Button
         android:id=@+id/out
         android:layout_width=fill_parent
         android:layout_height=wrap_content
         android:layout_weight=1
        

[android-developers] Re: Notepadv3 tutorial...

2010-03-08 Thread prachi
Hiii

The code will work if u give ur snippet of code in onMenuItemSelected
and not onContextItemSelected().
Or else you create your context menu in the method onCreateContextMenu
instead of onCreateOptionMenu() method.

Try it out.

On Mar 6, 12:59 am, MaTT macte...@gmail.com wrote:
 I was working through the Notepad 
 tutorial...http://developer.android.com/guide/tutorials/notepad/index.html

 ...and I seem to either have a misunderstanding of what is supposed to
 be happening, or the code is not working.

 Below are two snippets of code from the tutorial to illustrate my
 questions/concerns:

 It looks like this is the menu that is brought up when you have no
 items selected and you press the Menu key...
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
         menu.add(0, INSERT_ID, 0, R.string.menu_insert);
         return true;
     }

 ...this is the behavior that I expected and saw.

 However, when I have one of the notes selected, I would expect this
 code snippet to run...
         @Override
         public boolean onContextItemSelected(MenuItem item) {
                 switch(item.getItemId()) {
         case DELETE_ID:
                 AdapterContextMenuInfo info = (AdapterContextMenuInfo)
 item.getMenuInfo();
                 mDbHelper.deleteNote(info.id);
                 fillData();
                 return true;
                 }
                 return super.onContextItemSelected(item);
         }

 ...but it doesn't :(

 Can anyone help me out here?

 I can never get the delete option to show up in the tutorial.

 Thanks for  your help!
 -Matt

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


[android-developers] how can i make drag animation like in application menu and notification?

2010-03-08 Thread genxsol
Hi Dear,

i want to drag up and down or left and right same like we do to see
notifications and menu.

can anybody point to the right direction please?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: MultiScreen Support in Android?

2010-03-08 Thread javame_android
Hi,

Yes, obviously I have read that.

The problem is currently being solved by using different layout for
different screen. I have created layout-hdpi folder under res and
specified the layout file over there for high resolution screen.

But I still think there can be a better solution for this since if the
application was created using Android 1.5 then the application would
be going for compatibility mode and in that User interface was not
getting displayed properly.

Anyways thanks everybody for their valuable support.


Thanks  Regards
Sunil

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: AsyncTask and passing message back to UI Thread

2010-03-08 Thread John Wesonga
Figured this out, and its so simple, by passing the context as an
argument to my AsyncTask constructor I then have access to all the
stuff the UI thread has. In my onPostExecute(..) method all I did is
this:

Intent i=new Intent(ctx,SillyActivity.class);
ctx.startActivity(i);

Where ctx is a context object. I understand now that you can't call
methods from the UI thread in the AsyncTask.

On Mar 7, 1:08 am, John Wesonga johnweso...@gmail.com wrote:
 I figured something out which I thought would work, within my
 LoginTask class I created an object which was of the parent activity:

 Test101 mParentActivity;

 and then:

 protected void onPostExecute(String result) {

        Intent i=new Intent(ctx,SillyActivity.class);
        mParentActivity.startActivity(i);

 }

 An error is thrown:

 03-07 01:04:50.259: ERROR/AndroidRuntime(801): Uncaught handler:
 thread main exiting due to uncaught exception
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):
 java.lang.NullPointerException
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 org.tutorial.test101.tasks.LoginTask.onPostExecute(LoginTask.java:46)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 org.tutorial.test101.tasks.LoginTask.onPostExecute(LoginTask.java:1)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.AsyncTask.finish(AsyncTask.java:416)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.AsyncTask.access$300(AsyncTask.java:127)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:428)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.Looper.loop(Looper.java:123)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.app.ActivityThread.main(ActivityThread.java:3948)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 java.lang.reflect.Method.invoke(Method.java:521)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:782)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 dalvik.system.NativeStart.main(Native Method)

 Stuck again it seems..

 On Mar 6, 10:57 pm, John Wesonga johnweso...@gmail.com wrote:



  I just modified my onPostExecute(...) method:

  protected void onPostExecute(String result) {

                          Log.i(LOGGER, Done...);
                          pDialog.dismiss();
                          if(result==success){
                                  Toast.makeText(ctx, complete, 
  Toast.LENGTH_LONG).show();
                                  Intent i=new 
  Intent(ctx,SillyActivity.class);
                                  startActivity(i);
                          }else{
                                  Toast.makeText(ctx, fail, 
  Toast.LENGTH_LONG).show();
                          }

                  super.onPostExecute(result);
          }

  ctx is my context
  I noticed that I can't call the startActivity(Intent i) method within
  the AsyncTask, how else would I start an activity from here?

  On Mar 6, 10:13 pm, Romain Guy romain...@android.com wrote:

   onPostExecute() is invoked on the UI thread so you can use this method
   to start an Activity. It's pretty much what it's for.

   On Fri, Mar 5, 2010 at 6:29 AM, John Wesonga johnweso...@gmail.com 
   wrote:
I have a simple app and I'm using the AsyncTask to test out a
background process, for clearness purposes I've opted to put my
AsyncTask in a separate class rather than in an inner class, which
where my problems begin, this is my AsyncTask

package org.tutorial.test101.tasks;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

public class LoginTask extends AsyncTaskString, String, String {

       Context ctx;
       ProgressDialog pDialog;

       public LoginTask(Context context){
               super();
               this.ctx=context;
       }
      �...@override
       protected String doInBackground(String... params) {
               Log.i(LOGGER, Starting...);
               try{
                       Thread.sleep(8000);
               }catch(InterruptedException e){

               }
               return null;
       }

      �...@override
       protected void onPostExecute(String result) {

                       Log.i(LOGGER, Done...);
                       pDialog.dismiss();
                     //
               super.onPostExecute(result);
       }

      �...@override
       

[android-developers] Re: MultiScreen Support in Android?

2010-03-08 Thread String
What do you have in the support-screens element of your manifest? It's
not enough to simply have the tag there; its content will affect how
your activities render.

String

On Mar 8, 10:30 am, javame_android su...@softwebsolutions.com wrote:
 Hi,

 Yes, obviously I have read that.

 The problem is currently being solved by using different layout for
 different screen. I have created layout-hdpi folder under res and
 specified the layout file over there for high resolution screen.

 But I still think there can be a better solution for this since if the
 application was created using Android 1.5 then the application would
 be going for compatibility mode and in that User interface was not
 getting displayed properly.

 Anyways thanks everybody for their valuable support.

 Thanks  Regards
 Sunil

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Widget setOnClickPendingIntent not working

2010-03-08 Thread String
On Mar 8, 4:20 am, Kasra Rahjerdi johncena4presid...@gmail.com
wrote:

 when my widget is clicked
 nothing happens.

Try changing your PendingIntent.getBroadcast() call to a
getActivity(). If you're trying to start an activity, that would seem
to make more sense - and that's what works for my appwidgets.

String

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


Re: [android-developers] How to prevent animation when starting new task?

2010-03-08 Thread Thierry Legras
Hi,

I have the same issue as you but did not find any solution either :( .

In my case i use a TabHost where each tab has its own activity and at some
point i need to switch to another tab from one tab activity. As it is not
possible to do that from a tab activity, the best way i found is to restart
a new instance of the tabactivity and to finish the current one (ugly i
know...). I specified the NO_ANIMATION flag as well with no success, i still
have a animation.

Thierry.


2010/3/5 greenrobot kont...@greenrobot.de

 We are currently looking into methods how to implement tabs. TabHost
 has serious limitations and is no option. Instead, we are
 experimenting with our own tab solution, which has its own task
 (activity stack) for each tab.

 It's working well except that there's transition animation performed
 by the system when launching a new task the first time. The
 NO_ANIMATION parameter passed to startActivity has no effect in this
 case. The animation breaks the app visually - is there a way to
 prevent it?

 Thanks,
 Markus

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 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




-- 
Thierry.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 onRetainNonConfigurationInstance to keep Media player after orientation change

2010-03-08 Thread Chronos
Hi Martin,


I am not sure if this is the problem, but you should not keep
instances to the old activity during configuration change at all
(MediaPlayer is created with a Context); think about initializing and
managing the MediaPlayer in your Application class or a background
service, if you want it to survive configuration changes.


Have fun


On Feb 16, 1:24 pm, Martin Nilsson nilss...@yahoo.com wrote:
 It seems that my media player object is somehow destroyed when I use
 onRetainNonConfigurationInstance. I when I catch the object in
 createMediaPlayer below I can verify that mp != null. But when I try
 to get the current position with mp.getCurrentPosition() I get an
 exception and the activity shuts down. I can see the following in the
 log:

 02-16 10:45:55.869: DEBUG/StreamingPlayer(1854): restoreMediaPlayer
 02-16 10:45:55.879: DEBUG/AndroidRuntime(1854): Shutting down VM
 02-16 10:45:55.879: WARN/dalvikvm(1854): threadid=3: thread exiting
 with uncaught exception (group=0x4000fe70)
 02-16 10:45:55.889: ERROR/AndroidRuntime(1854): Uncaught handler:
 thread main exiting due to uncaught exception
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):
 java.lang.RuntimeException: Unable to start activity
 ComponentInfo{com.stericsson.streamingplayer/
 com.stericsson.streamingplayer.StreamingPlayer}:
 java.lang.IllegalStateException
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2268)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
 2284)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:
 3278)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread.access$1900(ActivityThread.java:112)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.os.Looper.loop(Looper.java:123)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread.main(ActivityThread.java:3948)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 java.lang.reflect.Method.invoke(Method.java:521)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:782)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 dalvik.system.NativeStart.main(Native Method)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854): Caused by:
 java.lang.IllegalStateException
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.media.MediaPlayer.getCurrentPosition(Native Method)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 com.stericsson.streamingplayer.StreamingPlayer.restoreMedidaPlayer(StreamingPlayer.java:
 233)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 com.stericsson.streamingplayer.StreamingPlayer.createMediaPlayer(StreamingPlayer.java:
 155)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 com.stericsson.streamingplayer.StreamingPlayer.onCreate(StreamingPlayer.java:
 94)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
 1123)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
 2231)
 02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     ... 12 more

 The code which gives the print  restoreMediaPlayer is located in
 function createMediaPlayer which I provided in my previous post.

 Why can't I pass trough the media player object when I can send
 variables just fine? Could it be that I need to create a new thread?
 When I start the media player the first time it looks like this in the
 code:

                                         Runnable r = new Runnable() {
                                                 public void run() {
                                                         setDataSource(path);
                                                         prepare();
                                                         start();
                                                 }
                                         };
                                         new Thread(r).start();

 But I wasn't able to reuse the code after orientation change, I still
 had my activity crashing.

 Regards

 Martin

 On 15 Feb, 13:46, Martin Nilsson nilss...@yahoo.com wrote:

  Hello,

  I am trying to keep a video playback going after a 

[android-developers] Re: INTERNET Permission

2010-03-08 Thread SREEHARI
 java.net.SocketException

Solution : try refreshing ur ip value and rebinding the socket to the
new ip.

Hope it will work...

REgards,

SREEHARI

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] [Bitmap] Problem with decodeByteArray

2010-03-08 Thread Paolo
I have a problem with this method decodeByteArray() when i try to
decode from a byte array an image as a Bitmap.

I explain it better:
I receive from a web server an XML file, which also contains a
thumbnail and some data.
I parse this file with SAX, so I can build an object populated with
all data, thumbnail included, as String.

Then I need to set the thumbnail into a ImageView, so I convert the
thumbanil string to byteArray with getBytes() and use it in this way:

byte[] dataImg = thumbnail_string.getBytes();

Bitmap b = BitmapFactory.decodeByteArray(dataImg, 0, dataImg.length);

At this point b is null and I can't set it into the ImageView.
I think it could be a problem of encoding/decoding any suggestions?

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


[android-developers] Can we move a window using movement keys?

2010-03-08 Thread Gladys
Hi,

Is there a possibility to move a window without moving internally?

Like, I have reduced the size of the Browser application 's window so
that it occupies one-fourth of the dimensions in the screen.

I have also written a code for the movement keys.

In the onKeyDown() of phone window,the code which i have written is


case KEYCODE_DPAD_RIGHT:
  WindowManager.LayoutParams lp =getAttributes();
   lp.y+=10;
 setAttributes(lp);
   break;

What I see is the window is moved first internally that is the scroll
bar at the bottom is moved and then only the window moves right...

How can I move the window without moving it internally?

Also,i can observe that the left movement key has no effect.

Please help me out in this.

thanks in advance

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


[android-developers] How to display all contacts?

2010-03-08 Thread Nox
Hello everybody,

I want to develop an app, which displays every Contacts with their
birthdays but I don´t know how to display the contacts.
Is there a way to do that?



Thanks in advance

From Viktor

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 onRetainNonConfigurationInstance to keep Media player after orientation change

2010-03-08 Thread jamesc
Have you read this?:

http://developer.android.com/intl/de/resources/articles/faster-screen-orientation-change.html

On Mar 8, 11:19 am, Chronos g358279012044...@gmail.com wrote:
 Hi Martin,

 I am not sure if this is the problem, but you should not keep
 instances to the old activity during configuration change at all
 (MediaPlayer is created with a Context); think about initializing and
 managing the MediaPlayer in your Application class or a background
 service, if you want it to survive configuration changes.

 Have fun

 On Feb 16, 1:24 pm, Martin Nilsson nilss...@yahoo.com wrote:

  It seems that my media player object is somehow destroyed when I use
  onRetainNonConfigurationInstance. I when I catch the object in
  createMediaPlayer below I can verify that mp != null. But when I try
  to get the current position with mp.getCurrentPosition() I get an
  exception and the activity shuts down. I can see the following in the
  log:

  02-16 10:45:55.869: DEBUG/StreamingPlayer(1854): restoreMediaPlayer
  02-16 10:45:55.879: DEBUG/AndroidRuntime(1854): Shutting down VM
  02-16 10:45:55.879: WARN/dalvikvm(1854): threadid=3: thread exiting
  with uncaught exception (group=0x4000fe70)
  02-16 10:45:55.889: ERROR/AndroidRuntime(1854): Uncaught handler:
  thread main exiting due to uncaught exception
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):
  java.lang.RuntimeException: Unable to start activity
  ComponentInfo{com.stericsson.streamingplayer/
  com.stericsson.streamingplayer.StreamingPlayer}:
  java.lang.IllegalStateException
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  2268)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
  2284)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:
  3278)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread.access$1900(ActivityThread.java:112)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.os.Handler.dispatchMessage(Handler.java:99)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.os.Looper.loop(Looper.java:123)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread.main(ActivityThread.java:3948)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  java.lang.reflect.Method.invokeNative(Native Method)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  java.lang.reflect.Method.invoke(Method.java:521)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  com.android.internal.os.ZygoteInit
  $MethodAndArgsCaller.run(ZygoteInit.java:782)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  dalvik.system.NativeStart.main(Native Method)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854): Caused by:
  java.lang.IllegalStateException
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.media.MediaPlayer.getCurrentPosition(Native Method)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  com.stericsson.streamingplayer.StreamingPlayer.restoreMedidaPlayer(StreamingPlayer.java:
  233)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  com.stericsson.streamingplayer.StreamingPlayer.createMediaPlayer(StreamingPlayer.java:
  155)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  com.stericsson.streamingplayer.StreamingPlayer.onCreate(StreamingPlayer.java:
  94)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
  1123)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
  android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
  2231)
  02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     ... 12 more

  The code which gives the print  restoreMediaPlayer is located in
  function createMediaPlayer which I provided in my previous post.

  Why can't I pass trough the media player object when I can send
  variables just fine? Could it be that I need to create a new thread?
  When I start the media player the first time it looks like this in the
  code:

                                          Runnable r = new Runnable() {
                                                  public void run() {
                                                          setDataSource(path);
                                                          prepare();
                                                          start();
                                                  }
                                          };
                                          new 

[android-developers] Re: About applying theme over application wide

2010-03-08 Thread James Wang
I think you should ask this one on android-porting.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Scheduling restart of crashed service, but no call to onStart() follows

2010-03-08 Thread James Wang
No. It is depend on system.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 onRetainNonConfigurationInstance to keep Media player after orientation change

2010-03-08 Thread Chronos
Exactly, what i was talking about:

Be very careful with the object you pass through
onRetainNonConfigurationChange(), though. If the object you pass is
for some reason tied to the Activity/Context, you will leak all the
views and resources of the activity. This means you should never pass
a View, a Drawable, an Adapter, etc. Photostream for instance extracts
the bitmaps from the drawables and pass the bitmaps only, not the
drawables. Finally, remember that onRetainNonConfigurationChange()
should be used only to retain data that is expensive to load.
Otherwise, keep it simple and let Android do everything.

On Mar 8, 12:50 pm, jamesc jame...@gmail.com wrote:
 Have you read this?:

 http://developer.android.com/intl/de/resources/articles/faster-screen...

 On Mar 8, 11:19 am, Chronos g358279012044...@gmail.com wrote:

  Hi Martin,

  I am not sure if this is the problem, but you should not keep
  instances to the old activity during configuration change at all
  (MediaPlayer is created with a Context); think about initializing and
  managing the MediaPlayer in your Application class or a background
  service, if you want it to survive configuration changes.

  Have fun

  On Feb 16, 1:24 pm, Martin Nilsson nilss...@yahoo.com wrote:

   It seems that my media player object is somehow destroyed when I use
   onRetainNonConfigurationInstance. I when I catch the object in
   createMediaPlayer below I can verify that mp != null. But when I try
   to get the current position with mp.getCurrentPosition() I get an
   exception and the activity shuts down. I can see the following in the
   log:

   02-16 10:45:55.869: DEBUG/StreamingPlayer(1854): restoreMediaPlayer
   02-16 10:45:55.879: DEBUG/AndroidRuntime(1854): Shutting down VM
   02-16 10:45:55.879: WARN/dalvikvm(1854): threadid=3: thread exiting
   with uncaught exception (group=0x4000fe70)
   02-16 10:45:55.889: ERROR/AndroidRuntime(1854): Uncaught handler:
   thread main exiting due to uncaught exception
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):
   java.lang.RuntimeException: Unable to start activity
   ComponentInfo{com.stericsson.streamingplayer/
   com.stericsson.streamingplayer.StreamingPlayer}:
   java.lang.IllegalStateException
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
   2268)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
   2284)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:
   3278)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread.access$1900(ActivityThread.java:112)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.os.Handler.dispatchMessage(Handler.java:99)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.os.Looper.loop(Looper.java:123)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread.main(ActivityThread.java:3948)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   java.lang.reflect.Method.invokeNative(Native Method)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   java.lang.reflect.Method.invoke(Method.java:521)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   com.android.internal.os.ZygoteInit
   $MethodAndArgsCaller.run(ZygoteInit.java:782)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   dalvik.system.NativeStart.main(Native Method)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854): Caused by:
   java.lang.IllegalStateException
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.media.MediaPlayer.getCurrentPosition(Native Method)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   com.stericsson.streamingplayer.StreamingPlayer.restoreMedidaPlayer(StreamingPlayer.java:
   233)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   com.stericsson.streamingplayer.StreamingPlayer.createMediaPlayer(StreamingPlayer.java:
   155)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   com.stericsson.streamingplayer.StreamingPlayer.onCreate(StreamingPlayer.java:
   94)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
   1123)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     at
   android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
   2231)
   02-16 10:45:55.919: ERROR/AndroidRuntime(1854):     ... 12 more

   The code which gives the print  restoreMediaPlayer is located in
   function createMediaPlayer which I provided in my previous post.

Re: [android-developers] Re: Photoshop.com Mobile editor now available as an Intent

2010-03-08 Thread Mark Murphy
ryan_f wrote:
 @Frank Weiss - I do not believe so.  I have not run any personal
 tests, but I have not seen any data I have not put there either.  Nor
 have I compared file space to see if there's any missing.  So I
 believe the permissions are still set and therefore private files are
 still unreadable even external to the phone.

There are no permissions on FAT32 (a.k.a., vfat) tied to Android. Any
file written there by applications is visible when you use the card
elsewhere.

This is a security hole only in the hands of foolish developers who
put secure data in an insecure medium, just as Facebook is a security
hole for anyone who publishes their list of personal passwords on their
Facebook page for all to see.

-- 
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
http://groups.google.com/group/android-developers?hl=en


[android-developers] question about search suggestion rating

2010-03-08 Thread Zhihong GUO
Hi All,

I am reading the source code that are related to search function. I can't
find the algorithm about the rating of the search suggestion, does anyone
can give me a hand?

Thanks a lot,

James

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: The life cycle of a static

2010-03-08 Thread Mark Murphy
westmeadboy wrote:
 But it seems that its important to know that you can't just set that
 at the point you call the new activity. Instead it seems you have to
 set it every time the VM is (re)created?

Yes. This is one of the many reasons to avoid such statics, particularly
for dynamic or mutable data.

 If you start Activity2 from Activity1 and the user hits home in
 Activity2 and the VM gets killed...then when the user returns to the
 app, Activity2 will get recreated, but Activity1 won't, right? 

Not immediately, no.

 If so,
 then Activity1 can't be used to set up the static used by Activity2.

Correct.

 Would be really useful if someone could confirm this.

Hi! Farproc speaks truth! :-)

 When starting a new Activity, I want to pass a complex object

Ick.

If this is truly transient state, make the object be Parcelable.

Otherwise, I encourage you to rethink your plan. Perhaps you need to
make those be one single activity rather than two. Or perhaps you need
the data to be mediated by another component (e.g., a service). Or,
perhaps you need the data to be static, but via some singleton object,
where that object is capable of lazy-rebuilding the data when needed
after a VM restart.

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

Android Online Training: 26-30 April 2010: http://onlc.com

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


[android-developers] Re: WakeLock finalized while still held?

2010-03-08 Thread Hunter Peress
Hello.

I too have a Service. It performs a task, and when finished, it
releases the wake-lock. There is a place to stop the service from
doing its work, and at this point I too release the wake-lock. So from
my perspective, I cleanly release the wakelock at all possible exit
points from my service.

 Yet every 250,000 monkey events or soeg 3+ hours of testing, I
get a Wake-lock finalized while still held exception. This irks me.

I don't see a benefit of your wakeful intent service. 2 differences
between it and my service is that it uses the synchronized keyword on
the getLock, and it makes the wakelock a static member (mine is a
class member) I don't see how either of these this would affect my
situation.


If I'm cleanly releasing the wakelock every time the service is
finished with its workthen where is wakelock exception being
thrown... from research, it would seem as if the service is killed
randomly, dirtily.

So...assuming this exception is thrown when the service is being ultra
hard kill-9 . Otherwise... I'm really looking for a faster way to
reproduce my bug, any ideas??



On Feb 20, 1:48 am, Mark Murphy mmur...@commonsware.com wrote:
 Starting from the beginning:

  Like scanning for voicemail, this background service needs to
  constantly, and forever, stay alert - checking the server every few
  minutes for notifications.

 Scanning for voicemail would not do that, and neither should your app.

 Please read this:

 http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-a...

 and this:

 http://www.androidguys.com/2009/12/07/code-pollution-boot-time-services/

 and watch this:

 http://www.youtube.com/watch?v=OUemfrKe65c

 and then switch to use an IntentService, perhaps a WakefulIntentService,
 triggered by AlarmManager. The advantage of WakefulIntentService is that
 it will hold aWakeLockonly as long as is needed to do your work,
 allowing the CPU to go back to sleep, ensuring maximal battery life.

 WakefulIntentService can be found here:

 http://github.com/commonsguy/cwac-wakeful

  3.) is there a way to have the service running indefinitely w/ an
  indefiniteWakeLock?

 No.

  I did figure it out.  I had mine being created in onStart().  I now declared
  it as a class field, create in on onCreate() and release it in onDestroy().
  Funny thing, it never gets released this way.

 Not releasing aWakeLockis just asking for users to march on your
 office, brandishing torches and pitchforks. Please reconsider.

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

 _The Busy Coder's Guide to Android Development_ Version 2.9
 Available!

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


Re: [android-developers] Re: WakeLock finalized while still held?

2010-03-08 Thread Mark Murphy
Hunter Peress wrote:
 I too have a Service. It performs a task, and when finished, it
 releases the wake-lock. There is a place to stop the service from
 doing its work, and at this point I too release the wake-lock. So from
 my perspective, I cleanly release the wakelock at all possible exit
 points from my service.

If you think your service will live forever, then you have missed an
exit point.

 I don't see a benefit of your wakeful intent service.

If you are looking to wake up the device and have a service perform some
work (and then go away, like services should do), WakefulIntentService
is a fine implementation of that pattern.

 If I'm cleanly releasing the wakelock every time the service is
 finished with its workthen where is wakelock exception being
 thrown... from research, it would seem as if the service is killed
 randomly, dirtily.

Services cannot live forever.

http://www.androidguys.com/2009/09/09/diamonds-are-forever-services-are-not

To the where is wakelock exception being thrown implied question,
check the Java stack trace.

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

Android Training in US: 14-18 June 2010: http://bignerdranch.com

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


Re: [android-developers] Re: WakeLock finalized while still held?

2010-03-08 Thread Mark Murphy
Hunter Peress wrote:
  Yet every 250,000 monkey events or soeg 3+ hours of testing, I
 get a Wake-lock finalized while still held exception. This irks me.

Since the Monkey only tests activities, how are your activities
communicating with the service?

If they are binding to the service, then I am definitely confused as to
why the service would be shut down, though there should be some notes
about that in logcat.

If they are using startService() and sending jobs over to the service
that way, then the notes in my previous post apply.

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

Android Training in NYC: 10-11 April 2010: http://guruloft.com

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


Re: [android-developers] Re: The life cycle of a static

2010-03-08 Thread Mark Murphy
westmeadboy wrote:
 The general situation is that I want multiple activities to have
 access to a single database (which needs to be open all the time since
 its the basis of just about every function/feature).
 
 Two approaches I can think of:
 
 1. Quick and dirty workaround: In the example I gave, if
 Activity2.onCreate() is called and the static has not been set, then
 call finish(). I assume this will this just lead to Activity1 being
 created? If so, that would be OK, for me.

Ick.

 2. Long-term good-practice approach: Handle opening/closing database
 in the Application object. This seems like a logical place to put this
 code. Initially, my app was just one activity and so I did all the app
 configuration in that activity's onCreate() method. It felt wrong
 then, and now I know why :)

I've used the Application object, and I've used static singletons.
Either way works. Particularly in your case, AFAICT, you just need
something that can lazy-open the database if it's not already open.

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

Android App Developer Training: 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: The life cycle of a static

2010-03-08 Thread westmeadboy
On Mar 8, 2:02 pm, Mark Murphy mmur...@commonsware.com wrote:
 westmeadboy wrote:
  1. Quick and dirty workaround: In the example I gave, if
  Activity2.onCreate() is called and the static has not been set, then
  call finish(). I assume this will this just lead to Activity1 being
  created? If so, that would be OK, for me.

 Ick.

Is it true that Activity1 would be automatically recreated? In other
words, is the activity stack preserved across VM kills?

Also, is the getIntent() data preserved?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: The life cycle of a static

2010-03-08 Thread westmeadboy
The general situation is that I want multiple activities to have
access to a single database (which needs to be open all the time since
its the basis of just about every function/feature).

Two approaches I can think of:

1. Quick and dirty workaround: In the example I gave, if
Activity2.onCreate() is called and the static has not been set, then
call finish(). I assume this will this just lead to Activity1 being
created? If so, that would be OK, for me.
2. Long-term good-practice approach: Handle opening/closing database
in the Application object. This seems like a logical place to put this
code. Initially, my app was just one activity and so I did all the app
configuration in that activity's onCreate() method. It felt wrong
then, and now I know why :)

Any thoughts?

On Mar 8, 1:25 pm, Mark Murphy mmur...@commonsware.com wrote:
 westmeadboy wrote:
  But it seems that its important to know that you can't just set that
  at the point you call the new activity. Instead it seems you have to
  set it every time the VM is (re)created?

 Yes. This is one of the many reasons to avoid such statics, particularly
 for dynamic or mutable data.

  If you start Activity2 from Activity1 and the user hits home in
  Activity2 and the VM gets killed...then when the user returns to the
  app, Activity2 will get recreated, but Activity1 won't, right?

 Not immediately, no.

  If so,
  then Activity1 can't be used to set up the static used by Activity2.

 Correct.

  Would be really useful if someone could confirm this.

 Hi! Farproc speaks truth! :-)

  When starting a new Activity, I want to pass a complex object

 Ick.

 If this is truly transient state, make the object be Parcelable.

 Otherwise, I encourage you to rethink your plan. Perhaps you need to
 make those be one single activity rather than two. Or perhaps you need
 the data to be mediated by another component (e.g., a service). Or,
 perhaps you need the data to be static, but via some singleton object,
 where that object is capable of lazy-rebuilding the data when needed
 after a VM restart.

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

 Android Online Training: 26-30 April 2010:http://onlc.com

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


[android-developers] Re: Dialogs on a change orientation

2010-03-08 Thread LeGeNDuS
Thanks for the answers I'm being looking the docs and I don't see
how to know the IdDialog I need to do the showDialog of the activity.
I have seen I must use onCreateDialog and in the internal switch put
the code to build itbut I need to pass more parameters to generate
the dialog and it only supports oneshould I use global
variables?...

On 5 mar, 16:44, TreKing treking...@gmail.com wrote:
 On Fri, Mar 5, 2010 at 6:04 AM, LeGeNDuS legen...@gmail.com wrote:
  is there anyway to fix this?.

 If you use Activity.showDialog() to show your dialogs, the activity will
 manage them for you and automatically restore them on orientation change.

 --- 
 --
 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 at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: The life cycle of a static

2010-03-08 Thread Mark Murphy
westmeadboy wrote:
 Is it true that Activity1 would be automatically recreated? In other
 words, is the activity stack preserved across VM kills?

AFAIK, yes.

 Also, is the getIntent() data preserved?

Yes.

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


Re: [android-developers] Re: How to end the Application?

2010-03-08 Thread TreKing
On Mon, Mar 8, 2010 at 12:47 AM, Farproc farp...@gmail.com wrote:

 try {
System.exit(0);
 } catch (SecurityException e) {


This is NOT recommended. Use finish() on your activities and let Android
deal your app when it's ready.

-
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] Tool to synchronize String properties betweens differents languages

2010-03-08 Thread chris
Hi all

Just a word to tell you that i put a tool to help you synchronize your
strings properties files here :
http://propertysync.appspot.com/synchronize.htm


You can zip your res directory , send it to the server and you will
get all you strings.xml files upgraded :

The missings strings will be added at the end of the localized files
and the unused strings in the localised files will be commented.

This way , you can check quickly if you did not forget to translate
any strings.

Hope you find this tool usefull.

Chris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Stopped unexpectedly on a real phone but not on the simulator

2010-03-08 Thread CMF
Do you mean the log on the simulator?
Or the real one?
 if it is the real one, how to keep track of the stack trace of the
log?

On Mar 8, 6:05 pm, Robert Green rbgrn@gmail.com wrote:
 Posting a stack trace from your log would be extremely helpful: )

 On Mar 8, 1:19 am, CMF manf...@gmail.com wrote:

  Hi all, I have an MapView app downloaded from internet, when I tested
  it on the simulator, everything is fine, but when I installed it on my
  phone, the app stopped unexpectedly. Here is the code

  public class CurrentLocationWithMap extends MapActivity {

      MapView map;

      MapController ctrlMap;
      Button inBtn;
      Button outBtn;
      ToggleButton switchMap;

      @Override
          protected boolean isRouteDisplayed() {
                  return false;
          }

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

          map = (MapView)findViewById(R.id.myMapView);
          ListOverlay overlays = map.getOverlays();
          MyLocationOverlay myLocation = new
  MyLocationOverlay(this,map);
          myLocation.enableMyLocation();
          overlays.add(myLocation);

          ctrlMap = map.getController();
          inBtn = (Button)findViewById(R.id.in);
          outBtn = (Button)findViewById(R.id.out);
          switchMap = (ToggleButton)findViewById(R.id.switchMap);

          OnClickListener listener = new OnClickListener() {
              @Override
              public void onClick(View v) {
                  switch (v.getId()) {
                  case R.id.in:
                      ctrlMap.zoomIn();
                      break;
                  case R.id.out:
                      ctrlMap.zoomOut();
                      break;
                  default:
                      break;
                  }
              }
          };
          inBtn.setOnClickListener(listener);
          outBtn.setOnClickListener(listener);

          //===

          switchMap.setOnCheckedChangeListener(new
  OnCheckedChangeListener() {
              @Override
              public void onCheckedChanged(CompoundButton cBtn, boolean
  isChecked) {
                  if (isChecked == true) {
                      map.setSatellite(true);
                  } else {
                      map.setSatellite(false);
                  }
              }
          });

          LocationManager locationManager;
          String context = Context.LOCATION_SERVICE;
          locationManager = (LocationManager)getSystemService(context);
          //String provider = LocationManager.GPS_PROVIDER;

          Criteria criteria = new Criteria();
          criteria.setAccuracy(Criteria.ACCURACY_FINE);
          criteria.setAltitudeRequired(false);
          criteria.setBearingRequired(false);
          criteria.setCostAllowed(true);
          criteria.setPowerRequirement(Criteria.POWER_LOW);
          String provider = locationManager.getBestProvider(criteria,
  true);

          Location location =
  locationManager.getLastKnownLocation(provider);
          updateWithNewLocation(location);
          locationManager.requestLocationUpdates(provider, 2000, 10,
                          locationListener);
      }
     private final LocationListener locationListener = new
  LocationListener() {
          public void onLocationChanged(Location location) {
          updateWithNewLocation(location);
          }
          public void onProviderDisabled(String provider){
          updateWithNewLocation(null);
          }
          public void onProviderEnabled(String provider){ }
          public void onStatusChanged(String provider, int status,
          Bundle extras){ }
      };
      private void updateWithNewLocation(Location location) {
          String latLongString;
          TextView myLocationText;
          myLocationText = (TextView)findViewById(R.id.myLocationText);
          if (location != null) {
              double lat = location.getLatitude();
              double lng = location.getLongitude();
              latLongString = Latitude: + lat + \nLongtitude: + lng;

              ctrlMap.animateTo(new GeoPoint((int)(lat*1E6),(int)
  (lng*1E6)));
          } else {
              latLongString = Position not found;
          }
          myLocationText.setText(Current location:\n +
          latLongString);

      }

  }

  ?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:id=@+id/myLocationText
      android:layout_width=fill_parent
      android:layout_height=wrap_content
      /
  LinearLayout
      android:orientation=horizontal
      android:layout_width=fill_parent
      android:layout_height=wrap_content 
      Button
          android:id=@+id/in
      

[android-developers] Logout gmail?

2010-03-08 Thread Carlos Yaconi
Hi!
I need to find a way to programmatically logout from gmail account. I've
noticed this happens when a new SIM card is inserted, but I need to do it
from my app.

Is this possible?

Thank you!

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

[android-developers] Runtime Language change support.

2010-03-08 Thread Alok Kulkarni
Hi guys,
I m developing an Android App which communicated with a server.
User can select a language of his choice at startup or during the App
execution lifetime.After selecting the lang, the corresponding XML file is
downloaded from server according to language which will map the Values of
Application strings accoding to that language.Can i do something like
replacing the default Strings.xml which contains English names(Say by
default) to the language selected by user.Better will be adding an XML file
per language and referring it runtime directly.
Thanks,
Alok.

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

Re: [android-developers] Re: How to end the Application?

2010-03-08 Thread Sean Hodges
On Mon, Mar 8, 2010 at 1:42 PM, TreKing treking...@gmail.com wrote:
 On Mon, Mar 8, 2010 at 12:47 AM, Farproc farp...@gmail.com wrote:

 try {
        System.exit(0);
 } catch (SecurityException e) {

 This is NOT recommended. Use finish() on your activities and let Android
 deal your app when it's ready.


TreKing is right, please don't use System.exit - use Activity.finish().

If you have multiple activities to close, use startActivityForResult()
and pass back a close now flag so you know to call finish() on the
parent activity as well.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 getInstallerPackageName the solution to piracy?

2010-03-08 Thread Carlo
and is the result consistent when you do install with adb at the
opposite of checking the market app ? because we know that those who
do pirate app will likely install using this developer tool

On Mar 6, 3:53 am, justinh henderson.jus...@gmail.com wrote:
 Carlo,

 You are wise to consider that. I've had varied results with it. Some
 phones don't show a result at all, even from free apps, at the correct
 SDK level. The market app also has a different package name on
 different phones. It would be a partial solution at best.

 On Mar 5, 1:38 pm, Carlo ca...@hyperdevbox.com wrote:



  Is the string returning by this function consistent  when bought from
  the legitimate google android market ?

  On Mar 6, 1:23 am, justinh henderson.jus...@gmail.com wrote:

   I have been seeing a remarkable increase in my apps being pirated. Not
   only are they 2 versions old, the name doesn't show up in Checkout,
   but getInstallerPackageName returns null where applicable. These
   people actually either have the wickedness, or the no brains, to send
   me a voluntary device report with this information. 75% of these
   reports sent yesterday were from pirated versions.

   So I'm tempted to simply check for getInstallerPackageName() to return
   a valid package name and if not then disallow the use of the app.
   Isn't it safe to assume that the ONLY method of install should be from
   the market? And that that method should always be available to someone
   who has purchased my app - from the Market?

   My concerns are that, since I'm resorting to this I'll start seeing
   legitimate purchase complaints somehow, and all of a sudden I get a
   flood of credit card charebacks.

   Sorry, kind of frustrated right now.

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


[android-developers] Google Checkout Order System Not Updating

2010-03-08 Thread polyclefsoftware
I'm not sure how many of you have noticed, but the reporting system of
Google Checkout has been broken since around noon on Friday. Orders
continue to display in the web interface, but any attempt to query for
orders via HTTP requests or exporting orders to .csv files only
returns updated information prior to 3/5/10. For example, if you had
50 sales yesterday and tried to access the orders via the notification
API or my exporting a spreadsheet, the request would return no
information.

I'm not even sure that the Google Checkout team is aware there is a
problem. I posted a message in the Google Checkout forum:

http://www.google.com/support/forum/p/checkout-merchants/thread?fid=57b72fe1ae70768a00048138098a14c5hl=en

There has been no official response. I realize it was over the
weekend, but it's really starting to have a negative impact. If you
are a dev affected by this, please either post in the thread I linked
to or try to contact Google. If someone from Google actually reads
this, could you please try to make the relevant team aware of this
issue if they are not already?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Making a clickable LinearLayout change color on click?

2010-03-08 Thread Mark Wyszomierski
Hi,

I have a linear layout, and I wanted to set its background to be a
rounded rect. I defined the background like so:

shape xmlns:android=http://schemas.android.com/apk/res/android;
  stroke android:width=1dip /
  padding android:left=7dip android:top=7dip android:right=7dip
android:bottom=7dip /
  corners android:radius=4dip /
/shape

that works ok, but I also wanted to make the background turn orange
when clicked (like as in a listview). In the past, I've done this to
get that effect:

  myView.setBackgroundDrawable(
 getDrawable(android.R.drawable.list_selector_background));

but this will just override the shape background definition I supplied
above. Do I have to make a state list, comprised of my shape
definition above, and another shape definition where the background is
orange?

Thanks

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


[android-developers] how can I put a newline into a format string

2010-03-08 Thread yaturner
I have the following string defined in strings.xml

string name=InfoLongb%1$s\%/bbr/Tie:%2$s\%br/Win%3$s\%/
string

and in my code:

String FormatStr = getResources().getString(R.string.InfoLong);
String resultsText = String.format( FormatStr, ---, --, --- 
);
CharSequence str = Html.fromHtml(resultsText);
percent.setText( str );

what I would like to get is:

---%
Tie:--% Win:---%

what I get is:

--%br/Tie:--%Win:---%

I have also tried \n and \\n instead of br/ with similar results

My question is:

Can I embed a newline in a format string?

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


Re: [android-developers] how can I put a newline into a format string

2010-03-08 Thread Mark Murphy
yaturner wrote:
 I have the following string defined in strings.xml
 
 string name=InfoLongb%1$s\%/bbr/Tie:%2$s\%br/Win%3$s\%/
 string
 
 and in my code:
 
   String FormatStr = getResources().getString(R.string.InfoLong);
   String resultsText = String.format( FormatStr, ---, --, --- 
 );
   CharSequence str = Html.fromHtml(resultsText);
   percent.setText( str );
 
 what I would like to get is:
 
 ---%
 Tie:--% Win:---%
 
 what I get is:
 
 --%br/Tie:--%Win:---%
 
 I have also tried \n and \\n instead of br/ with similar results
 
 My question is:
 
 Can I embed a newline in a format string?

Yes, though I think your problem is more tied to the combination of the
newline and Html.fromHtml().

\n works. However, I think that will be converted into a space by
Html.fromHtml().

You might try br instead of the XHTML br/ and see if that helps.

-- 
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: Samsung Moment does not return anything in parameters.getSupportedFlashModes()

2010-03-08 Thread Streets Of Boston
Bump.. sorry...

Anyone knows how to control the flash on Samsung (Moment)?  I guess
it's some set of name/value pairs to be set in the Camera.Parameters
instance.

The Camera.Parameters.get(flash-mode-values) seems to returns null
and therefore my app can't query the phone's flahs capabilities.

On Mar 6, 11:26 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 The Samsung Moment moment has a flash onboard that can be used for
 taking pics. But, from customers i learned that the Samsung Moment
 does not return anything when parameters.getSupportedFlashModes() is
 called.

 If this is a bug, what is are the android.os.Build.MODEL,
 android.os.Build.DEVICE and android.os.Build.BRAND of this phone and
 the accepted values for
 'parameters.setFlashMode(flashModeParamValue)'?

 Thank you!

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


[android-developers] How to detect when android kill my process?

2010-03-08 Thread miguelo
Hi, I have a problem when android decides to kill my process, because
when it is restored, it crashs because my Application object is
restored and has lost important info that was stored in it.

I have readed in Activity Lifecycke chapter on API documentation that
If an activity is paused or stopped, the system can drop the activity
from memory by either asking it to finish, or simply killing its
process. When it is displayed again to the user, it must be completely
restarted and restored to its previous state.

Is there any way for my application to know if the system has killed
my process before and is trying to restore it right now?

Thanks in advance and regards!

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


[android-developers] Re: Can't build Android SDK

2010-03-08 Thread SN
The above error of AlarmClock is caused by my download is corrupted.
After delete everything and start a new download again. It passed that
error but another error showed up:

Docs droiddoc: out/target/common/docs/services
javadoc: error - In doclet class DroidDoc,  method start has thrown an
exception java.lang.reflect.InvocationTargetException
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for
sun.util.resources.OpenListResourceBundle not found
1 error
make: *** [out/target/common/docs/services-timestamp] Error 45



Can anybody help me fix this error? This is an straight download from
repository and i can't get it build successful.

Thanks,

On Mar 6, 2:36 am, SN sontran...@gmail.com wrote:
 Thanks Xavier! It is working. However thebuildfails at this step:

 Install: out/target/product/generic/system/app/
 AccountAndSyncSettings.apk
 target R.java/Manifest.java: AlarmClock (out/target/common/obj/APPS/
 AlarmClock_intermediates/src/R.stamp)
 packages/apps/AlarmClock/res/values-el/strings.xml:44: error: Error
 parsing XML: not well-formed (invalid token)
 make: *** [out/target/common/obj/APPS/AlarmClock_intermediates/src/
 R.stamp] Error 1

 It looks like the strings xml for AlarmClock is not correct. Is there
 a fix for this xml or mybuilddoesn't set up correctly?

 Thanks,

 On Mar 4, 7:17 pm, Xavier Ducrohet x...@android.com wrote:

  use lunchsdk-eng followed by makesdk

  On Thu, Mar 4, 2010 at 6:48 AM, SN sontran...@gmail.com wrote:
   Can anybody help me building AndroidSDK? I followed all the steps to
   download AndroidSDKand when I try tobuildit. I got error. Here is
   all my step of building it.

   $ sourcebuild/envsetup.sh
   including vendor/aosp/vendorsetup.sh
   $ lunch 1

   
   PLATFORM_VERSION_CODENAME=AOSP
   PLATFORM_VERSION=AOSP
   TARGET_PRODUCT=generic
   TARGET_BUILD_VARIANT=eng
   TARGET_SIMULATOR=false
   TARGET_BUILD_TYPE=release
   TARGET_ARCH=arm
   HOST_ARCH=x86
   HOST_OS=linux
   HOST_BUILD_TYPE=release
   BUILD_ID=MASTER
   

   $ make
   
   PLATFORM_VERSION_CODENAME=AOSP
   PLATFORM_VERSION=AOSP
   TARGET_PRODUCT=generic
   TARGET_BUILD_VARIANT=eng
   TARGET_SIMULATOR=false
   TARGET_BUILD_TYPE=release
   TARGET_ARCH=arm
   HOST_ARCH=x86
   HOST_OS=linux
   HOST_BUILD_TYPE=release
   BUILD_ID=MASTER
   
   ***Buildconfiguration changed: generic-eng-sdk-{mdpi} - generic-
   eng-{mdpi}
   *** Forcing make installclean...
   *** Done with the cleaning, now starting the realbuild.
  build/core/base_rules.mk:117: ***sdk/archquery/src:
   MODULE.HOST.JAVA_LIBRARIES.archquery already defined by development/
   tools/archquery/src.  Stop

   I tried with 'makesdk' also but got the same error. Does anybody know
   how to fix it?

   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

  --
  Xavier Ducrohet
  AndroidSDKTech Lead
  Google Inc.

  Please do not send me questions directly. 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: Can I get sued for using Android Caller ID?? -Please answer

2010-03-08 Thread monmonja
First of all thanks for using my example :) On the patent thing, if
you have a good idea similar to something that is patented, i suggest
you to put your app on other country besides US or the list of
countries that have the patent (you can google search them). One
reason is that the patent system in US is kind of a mess right now
(sorry guys its just is). Most patents in US are not global patents so
in a sea of 140+ countries, there is a good chance your app would be
big somewhere else. On the localization part, there are a lot of
willing individual on that certain country that could speak english
and is willing to translate the app for you. Btw im not a US hater but
i hate the patent system there, it kills further innovations.

On Mar 3, 12:51 am, chris harper ch393...@gmail.com wrote:
 I agree it all depends on if your app makes money. If they see something
 that makes money they will come after you if you violate a Patent. In my
 case I did my homework and found out now before my app goes out that someone
 holds a patent on any case when someone takes any graphic of any image that
 represents a head and places it on graphic of anything that represents a
 body. Like JibJab does. If you look at the legal part of their JibJab's web
 site they have to pay pixfusion a license fee (at the very bottom).

 http://sendables.jibjab.com/about/legal

 Which is what my app is going to do (take a head and place it on a body).

 I wrote pixfusion two emails asking about licenses fee's and what I was
 developing but I never heard back. So I'll keep the emails that I wrote and
 if (by chance) my app does get a little popular and I do hear from them then
 I will have proof that I tried contacting them and I was proactive.

 For any developers out there reading this do a little googling on any
 major features of your app and just aware that there are MANY patents out
 there. Where if your app takes off you could get an email from some BS
 company saying you have to pay them licenses fees and/or a cease and desist
 order like K05tik got.

 There is nothing worse for a developer then spending hours of time
 developing and coding something just to find out that they have to stop
 publishing it.

 Thanks
 -Chris



 On Tue, Mar 2, 2010 at 1:15 AM, ko5tik kpriblo...@yahoo.com wrote:
  In today society everybody  can sue you for almost anything at any
  time
  ( we live in kind of free countries, in unfree countrys you will be
  just thrown to jail  )
  in case of tetris applet they claimed copyright on 4-block tiles ;)
  ( which were used in a books back in 70ies )

  Software patents do suck,  as well as actual copyright laws  ( for
  example in germany,
  EUR 0.06 per blank CD goes straight to GEMA , as well as EUR 30 on
  every new
  PC sold, and they still claim that you download music illegally)  -
  so please support your
  local pirate party.

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dialogs on a change orientation

2010-03-08 Thread LeGeNDuS
Thanks for the answers I'm being looking the docs and I don't see
how to know the IdDialog I need to do the showDialog of the activity.
I have seen I must use onCreateDialog and in the internal switch put
the code to build itbut I need to pass more parameters to
generate
the dialog and it only supports oneshould I use global
variables?...

On 5 mar, 12:04, LeGeNDuS legen...@gmail.com wrote:
 Hello!

 I'm doing an APP that shows some dialogs. Those dialogs are Alert
 dialogs, and when they are being showed if I change theorientationof
 the mobile I lost them...they are not being kept on the screen. is
 there anyway to fix this?.

 Thank you so much

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


Re: [android-developers] How to detect when android kill my process?

2010-03-08 Thread TreKing
On Mon, Mar 8, 2010 at 10:09 AM, miguelo miguel...@gmail.com wrote:

 I have readed in Activity Lifecycke chapter on API documentation that
 If an activity is paused or stopped, the system can drop the activity
 from memory by either asking it to finish, or simply killing its
 process. When it is displayed again to the user, it must be completely
 restarted and restored to its previous state.

 Is there any way for my application to know if the system has killed
 my process before and is trying to restore it right now?


Did you readed about onSavedInstanceState and onRestoreInstanceState ?

-
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: Dialogs on a change orientation

2010-03-08 Thread TreKing
On Mon, Mar 8, 2010 at 7:11 AM, LeGeNDuS legen...@gmail.com wrote:

 I'm being looking the docs and I don't see
 how to know the IdDialog I need to do the showDialog of the activity.


The dialog ID you use is defined by you and can be any integer that uniquely
identifies the dialog you want to show.


 I have seen I must use onCreateDialog and in the internal switch put
 the code to build itbut I need to pass more parameters to generate
 the dialog and it only supports oneshould I use global
 variables?...


Well, Java doesn't really support globals in the true sense, but in any
case, no, I would steer away from anything of that sort. Use local or
class-level variables wherever you can. And don't forget you have
onPrepareDialog to configure the dialog however you need before it's shown.

-
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] Handling multiple resource trees

2010-03-08 Thread lordjoe
I am splitting my code into a common source tree witb code to share
among multiple android projects and
project specific source trees. This works well except for resources.
My development environment (intellij) has problems with
multiple resouce trees and gives strange errors when multiple res
directories are included -
Has anyone gotten this going and if so how were multiple resource
directories handled

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


[android-developers] Re: Problem with decodeByteArray

2010-03-08 Thread Bob Kerns
First, doing String.getBytes() involves converting the string into
some random encoding. You may know what encoding it happens to be on
Android devices, and perhaps it even won't change depending on what
country the device is being used in -- but me, I would never go NEAR
that method. Do not use it for any purpose; any use of it is sure to
be a bug. I have fixed an ENORMOUS number of bugs in people's code,
where the sole cause was calling this method.

Originally, your data is received via SAX as a char[] array, not a
string. That would be closer to what you want, in theory --- but:

Critical point: YOU CANNOT SEND UNENCODED BINARY DATA VIA XML. It's
not just that some characters have to be quoted. Some byte sequences
are not legal characters. When encountering these, a conforming parser
with throw an exception -- because it is not XML.

If the web service is actually doing this, the web service needs to be
redone.

More likely, the web service is sending the data encoded; for example,
it could be using Base64 encoding. You can work with this as a string
if you want (though that involves extra memory usage), but you have to
decode it to get the byte[] you'll need to construct the bitmap.

On Mar 8, 3:38 am, Paolo brand...@gmail.com wrote:
 I have a problem with this method decodeByteArray() when i try to
 decode from a byte array an image as a Bitmap.

 I explain it better:
 I receive from a web server an XML file, which also contains a
 thumbnail and some data.
 I parse this file with SAX, so I can build an object populated with
 all data, thumbnail included, as String.

 Then I need to set the thumbnail into a ImageView, so I convert the
 thumbanil string to byteArray with getBytes() and use it in this way:

 byte[] dataImg = thumbnail_string.getBytes();

 Bitmap b = BitmapFactory.decodeByteArray(dataImg, 0, dataImg.length);

 At this point b is null and I can't set it into the ImageView.
 I think it could be a problem of encoding/decoding any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dialogs on a change orientation

2010-03-08 Thread LeGeNDuS
Thank you... I have tried to do thisbut it doens't work so
fine. here the code:

protected Dialog onCreateDialog(int id) {
Dialog dialog;
switch(id) {
case ACTION_DIALOG:
dialog = showActionDialog(classcodecategory, classtextout);
break;
default:
dialog = null;
}
return dialog;
}

When I show it for first time it's showed fine, but when I change the
orientation it only keep the negative button of the dialog, the rest
is empty.

Apart of that...when I pass to other activity and come again to this
one, I need to show again this dialog, but modified, and it always
show  the first dialog

On 5 mar, 12:04, LeGeNDuS legen...@gmail.com wrote:
 Hello!

 I'm doing an APP that shows some dialogs. Those dialogs are Alert
 dialogs, and when they are being showed if I change theorientationof
 the mobile I lost them...they are not being kept on the screen. is
 there anyway to fix this?.

 Thank you so much

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Making a clickable LinearLayout change color on click?

2010-03-08 Thread Romain Guy
 but this will just override the shape background definition I supplied
 above. Do I have to make a state list, comprised of my shape
 definition above, and another shape definition where the background is
 orange?

That's exactly what you have to do!


 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




-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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


Re: [android-developers] Re: AsyncTask and passing message back to UI Thread

2010-03-08 Thread Romain Guy
 Where ctx is a context object. I understand now that you can't call
 methods from the UI thread in the AsyncTask.

You can call method on the UI thread in AsyncTask, that's what it's
for. But you cannot call method from other classes (like Context)
unless you have instances of them. This is no different than in any
other place of your application :)


 On Mar 7, 1:08 am, John Wesonga johnweso...@gmail.com wrote:
 I figured something out which I thought would work, within my
 LoginTask class I created an object which was of the parent activity:

 Test101 mParentActivity;

 and then:

 protected void onPostExecute(String result) {

        Intent i=new Intent(ctx,SillyActivity.class);
        mParentActivity.startActivity(i);

 }

 An error is thrown:

 03-07 01:04:50.259: ERROR/AndroidRuntime(801): Uncaught handler:
 thread main exiting due to uncaught exception
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):
 java.lang.NullPointerException
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 org.tutorial.test101.tasks.LoginTask.onPostExecute(LoginTask.java:46)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 org.tutorial.test101.tasks.LoginTask.onPostExecute(LoginTask.java:1)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.AsyncTask.finish(AsyncTask.java:416)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.AsyncTask.access$300(AsyncTask.java:127)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:428)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.os.Looper.loop(Looper.java:123)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 android.app.ActivityThread.main(ActivityThread.java:3948)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 java.lang.reflect.Method.invoke(Method.java:521)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:782)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
 03-07 01:04:50.319: ERROR/AndroidRuntime(801):     at
 dalvik.system.NativeStart.main(Native Method)

 Stuck again it seems..

 On Mar 6, 10:57 pm, John Wesonga johnweso...@gmail.com wrote:



  I just modified my onPostExecute(...) method:

  protected void onPostExecute(String result) {

                          Log.i(LOGGER, Done...);
                          pDialog.dismiss();
                          if(result==success){
                                  Toast.makeText(ctx, complete, 
  Toast.LENGTH_LONG).show();
                                  Intent i=new 
  Intent(ctx,SillyActivity.class);
                                  startActivity(i);
                          }else{
                                  Toast.makeText(ctx, fail, 
  Toast.LENGTH_LONG).show();
                          }

                  super.onPostExecute(result);
          }

  ctx is my context
  I noticed that I can't call the startActivity(Intent i) method within
  the AsyncTask, how else would I start an activity from here?

  On Mar 6, 10:13 pm, Romain Guy romain...@android.com wrote:

   onPostExecute() is invoked on the UI thread so you can use this method
   to start an Activity. It's pretty much what it's for.

   On Fri, Mar 5, 2010 at 6:29 AM, John Wesonga johnweso...@gmail.com 
   wrote:
I have a simple app and I'm using the AsyncTask to test out a
background process, for clearness purposes I've opted to put my
AsyncTask in a separate class rather than in an inner class, which
where my problems begin, this is my AsyncTask

package org.tutorial.test101.tasks;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;

public class LoginTask extends AsyncTaskString, String, String {

       Context ctx;
       ProgressDialog pDialog;

       public LoginTask(Context context){
               super();
               this.ctx=context;
       }
      �...@override
       protected String doInBackground(String... params) {
               Log.i(LOGGER, Starting...);
               try{
                       Thread.sleep(8000);
               }catch(InterruptedException e){

               }
               return null;
       }

      �...@override
       protected void onPostExecute(String result) {

                       Log.i(LOGGER, Done...);
                       pDialog.dismiss();
                     //
               super.onPostExecute(result);
       }

      �...@override
       protected void onPreExecute() {
       

Re: [android-developers] Re: Dialogs on a change orientation

2010-03-08 Thread TreKing
On Mon, Mar 8, 2010 at 11:02 AM, LeGeNDuS legen...@gmail.com wrote:

 When I show it for first time it's showed fine, but when I change the
 orientation it only keep the negative button of the dialog, the rest
 is empty.


Maybe post the code for showActionDialog()? In particular what
classcodecategory and classtextout are.


 Apart of that...when I pass to other activity and come again to this
 one, I need to show again this dialog, but modified, and it always
 show  the first dialog


Like I said before:

 And don't forget you have onPrepareDialog to configure the dialog however
 you need before it's shown.


-
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] Same Issue

2010-03-08 Thread Tin
Hi, I also have same issue. The update works on 1.6 but not in 2.1.
The error is ERROR/DatabaseUtils(98):
java.lang.IllegalArgumentException: Empty values.

Anyone got solution for this please?

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] getHitRect - Android 1.5

2010-03-08 Thread Keith R
Why is the top and botton always the same when calling the getHitRect
on a view?  The left and right appear to be changing correctly.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Protocol exception : too many redirects

2010-03-08 Thread steVe
Hi All,

I get this protocol exception error when I try to read a rss feed. Its
loading fine on the emulator. But when I test on my device (Droid), it
throws the below error.

---
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): Caused by:
java.net.ProtocolException: Too many redirects
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequestInternal(HttpURLConnection.java:
1626)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.doRequest(HttpURLConnection.java:
1551)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:
1052)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): at
com.aol.engadget.parser.BaseFeedParser.getInputStream(BaseFeedParser.java:
45)
03-08 12:29:25.210: ERROR/AndroidRuntime(5108): ... 9 more
---

It stops here on getInputStream.

At the same time I am reading another two feeds from the same server.
It loads and parses fine...

Here is the code

Xml.parse(this.getInputStream(), Xml.Encoding.UTF_8,
root.getContentHandler());

protected InputStream getInputStream() {
try {
URLConnection feedCon = feedUrl.openConnection();

return feedCon.getInputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
}


Am I doing anything wrong ? Or is it a bug ?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Move the virtual keyboard to the top of the screen (SIP - IME)

2010-03-08 Thread tnkirk
Please let me know if you find anything. I'm trying to make a custom
keyboard layout that is stuck to the right side of the screen, and
have been banging my head against the interface for days, trying to
figure out how to break the KeyboardView out of its default position.

Tim


On Feb 2, 4:16 am, flsobral flsob...@gmail.com wrote:
 Hello.

 I'm looking for a way to move the virtual keyboard to the top of the
 screen, rather than the bottom. Is it possible?

 Thanks in advance.

 Fabio.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Positioning/Layout of the Input Method / Soft Keyboard

2010-03-08 Thread tnkirk
Did you ever have any luck positioning the SoftKeyboard? I'm working
on a keyboard that needs to be aligned to the right side of the
screen, and haven't been able to get any of the layout options such as
gravity=right or layout_alignParentRight=true  to work.

Tim


On Mar 4, 2:48 am, Aracos kai.hen...@googlemail.com wrote:
 Hi everyone,
 For an Android 1.5 device I need to implement a new Soft Input (SoftKeyboard) 
 that is not located at either side of the Screen but rather
 at a corner. I have the layout ready but I can’t get the
 InputMethodManager to locate my input Method View to be displayed
 before the Activity without resizing it and positioning it at the
 corner.
 What I have done:
 -       I implemented my own SoftKeyboardusing the SoftKeyboardSample
 from the Android 1.5 SDK. The View used to display thekeyboardnow
 holds my own layout.
 -       My SoftKeyboard class (derived from InputMethod) sets  the layout to
 WRAP_CONTENT for width and height.
 onEvaluateFullscreenMode() always returns false since I don’t want /
 need id.
 The problem is, that my SoftKeyboardis now located within the center
 of the Screen rather than at one corner and the Actvity scrolls down
 when I reach the height of my SoftKeyboardalthough it would be
 displayed correctly besides it.
 I hope I made myself clear because, unfortunately, I can’t post any
 codes or screenshots here for confidentiality reasons.

 Thank you all for your help, it is greatly appreciated.

 Kai aka Aracos

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Motorola Droid (possible android) multi-touch bug and how to reproduce

2010-03-08 Thread MrStatler
Hi,

I have encountered this bug on Motorola Milestone (German version of
droid)

1. Finger 1 goes down
2. Finger 2 goes down
3. Finger 1 goes up
4. Finger 1 goes back down

Then I have very close or identical X,Y for both pointers.

Best Regards
Darek


On Jan 15, 5:09 pm, Mirmathrax mirmath...@gmail.com wrote:
 Multi-touchAPI is bugged (at least on Motorola Droid). Here is a
 method toreproducethe error for analysis:

 1)  Create a new android project in Eclipse with the following fields:

  Project name:           PointerLocation
  Build target:              Android 2.0.1
  Application Name:     PointerLocation
  Package Name:        com.example.pointerlocation
  Create Activity:         PointerLocation

 2)  Copy the following code and paste this into the
 PointerLocation.java file that is automatically created

 /*
  * Copyright (C) 2007 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */

 package com.example.pointerlocation;

 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.Paint.FontMetricsInt;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.MotionEvent;
 import android.view.ViewConfiguration;
 import android.view.WindowManager;
 import android.view.VelocityTracker;
 import android.view.View;

 import java.util.ArrayList;

 /**
  * Demonstrates wrapping a layout in a ScrollView.
  *
  */
 public class PointerLocation extends Activity {
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(new MyView(this));

         // Make the screen full bright for this activity.
         WindowManager.LayoutParams lp = getWindow().getAttributes();
         lp.screenBrightness = 1.0f;
         getWindow().setAttributes(lp);
     }

     public static class PointerState {
         private final ArrayListFloat mXs = new ArrayListFloat();
         private final ArrayListFloat mYs = new ArrayListFloat();
         private boolean mCurDown;
         private int mCurX;
         private int mCurY;
         private float mCurPressure;
         private float mCurSize;
         private int mCurWidth;
         private VelocityTracker mVelocity;
     }

     public class MyView extends View {
         private final ViewConfiguration mVC;
         private final Paint mTextPaint;
         private final Paint mTextBackgroundPaint;
         private final Paint mTextLevelPaint;
         private final Paint mPaint;
         private final Paint mTargetPaint;
         private final Paint mPathPaint;
         private final FontMetricsInt mTextMetrics = new FontMetricsInt
 ();
         private int mHeaderBottom;
         private boolean mCurDown;
         private int mCurNumPointers;
         private int mMaxNumPointers;
         private final ArrayListPointerState mPointers
                  = new ArrayListPointerState();

         public MyView(Context c) {
             super(c);
             mVC = ViewConfiguration.get(c);
             mTextPaint = new Paint();
             mTextPaint.setAntiAlias(true);
             mTextPaint.setTextSize(10
                     * getResources().getDisplayMetrics().density);
             mTextPaint.setARGB(255, 0, 0, 0);
             mTextBackgroundPaint = new Paint();
             mTextBackgroundPaint.setAntiAlias(false);
             mTextBackgroundPaint.setARGB(128, 255, 255, 255);
             mTextLevelPaint = new Paint();
             mTextLevelPaint.setAntiAlias(false);
             mTextLevelPaint.setARGB(192, 255, 0, 0);
             mPaint = new Paint();
             mPaint.setAntiAlias(true);
             mPaint.setARGB(255, 255, 255, 255);
             mPaint.setStyle(Paint.Style.STROKE);
             mPaint.setStrokeWidth(2);
             mTargetPaint = new Paint();
             mTargetPaint.setAntiAlias(false);
             mTargetPaint.setARGB(255, 0, 0, 192);
             mPathPaint = new Paint();
             mPathPaint.setAntiAlias(false);
             mPathPaint.setARGB(255, 0, 96, 255);
             mPaint.setStyle(Paint.Style.STROKE);
             mPaint.setStrokeWidth(1);

             PointerState ps = new PointerState();
             ps.mVelocity = VelocityTracker.obtain();
             mPointers.add(ps);
         }

         @Override
         protected void onMeasure(int widthMeasureSpec, int
 heightMeasureSpec) {
             

[android-developers] What is the deal with the android: namespace?

2010-03-08 Thread sstrenn
Is there any plan to eliminate the requirement to add the android:
namespace to attributes in layout files?

In my current project, android: prefixes make up a little over 20%
of all of the text in the layout files.  And instead of adding value,
they make the files VERY DIFFICULT TO READ AND EDIT.  I believe it is
a well known maxim in the developer community that code is read many
more times than it is written.

Is there any relief in sight?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Live Wallpapers. Cant get actions like android.wallpaper.tap

2010-03-08 Thread STKFF
I'm facing the very same issue. Did you find the solution ?


On 11 fév, 03:52, vovkab vov...@gmail.com wrote:
 Can't get actions like:
 # android.wallpaper.tap
 # android.home.drop

 I tried on CubeWallpaperexample by adding to CubeEngine class:
                 @Override
                 public BundleonCommand(String action, int x, int y, int z, 
 Bundle
 extras,
                                 boolean resultRequested) {
                         System.out.println(action + action);
                         return super.onCommand(action, x, y, z, extras, 
 resultRequested);
                 }

 No actions happens by tapping dropping and etc.

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


[android-developers] How to use the photo picker and specify a folder

2010-03-08 Thread Richard
I've been looking into the photo picker which I want to use as part of
an application I am developing. I have set up the picker to respond to
intents and have tested it in my application. However the way I am
hoping to use the photo picker is to restrict it to a specific folder
on the SD card. Is this possible, I have looked through the API/SDK
and have not found the information I was looking for. Thanks in
advance for any help.

Thanks,
-Rick

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] PPPD and AT commands.

2010-03-08 Thread ZhangJieJing
Hi,

you can just get a chat.c code in any pppd code. it will work find.
I had used it.
---
Best regards,
Zhang Jiejing


On Thu, Feb 25, 2010 at 3:58 AM, Hamilton Vera hamilton.lis...@gmail.comwrote:

 Hail everybody

 I am trying to use a USB GPRS (SIM5218A) modem in eclair, I am
 wondering how to send the AT commands to the modem.

 I saw some old emails here in the list showing how to use pppd with
 chat (exec /system/usr/bin/chat -v) ;

 http://www.mail-archive.com/android-port...@googlegroups.com/msg03704.html
 http://www.mail-archive.com/android-port...@googlegroups.com/msg09252.html

 Unfortunately I am unable to find chat in eclair. Is there a better
 way to perform this?

 Thanks in advance.

 --
 Hamilton Vera
 http://hvera.wordpress.com

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.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: Motorola Droid (possible android) multi-touch bug and how to reproduce

2010-03-08 Thread MrStatler
Hi,

I have encountered the same problem on Motorola Milestone (German
version of droid)

After finger 1 is back down I have very close or the same X,Y for both
pointers.

Best Regards
Darek


On Jan 15, 5:09 pm, Mirmathrax mirmath...@gmail.com wrote:
 Multi-touchAPI is bugged (at least on Motorola Droid). Here is a
 method to reproduce the error for analysis:

 1)  Create a new android project in Eclipse with the following fields:

  Project name:           PointerLocation
  Build target:              Android 2.0.1
  Application Name:     PointerLocation
  Package Name:        com.example.pointerlocation
  Create Activity:         PointerLocation

 2)  Copy the following code and paste this into the
 PointerLocation.java file that is automatically created

 /*
  * Copyright (C) 2007 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */

 package com.example.pointerlocation;

 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.Paint.FontMetricsInt;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.MotionEvent;
 import android.view.ViewConfiguration;
 import android.view.WindowManager;
 import android.view.VelocityTracker;
 import android.view.View;

 import java.util.ArrayList;

 /**
  * Demonstrates wrapping a layout in a ScrollView.
  *
  */
 public class PointerLocation extends Activity {
     @Override
     protected void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         setContentView(new MyView(this));

         // Make the screen full bright for this activity.
         WindowManager.LayoutParams lp = getWindow().getAttributes();
         lp.screenBrightness = 1.0f;
         getWindow().setAttributes(lp);
     }

     public static class PointerState {
         private final ArrayListFloat mXs = new ArrayListFloat();
         private final ArrayListFloat mYs = new ArrayListFloat();
         private boolean mCurDown;
         private int mCurX;
         private int mCurY;
         private float mCurPressure;
         private float mCurSize;
         private int mCurWidth;
         private VelocityTracker mVelocity;
     }

     public class MyView extends View {
         private final ViewConfiguration mVC;
         private final Paint mTextPaint;
         private final Paint mTextBackgroundPaint;
         private final Paint mTextLevelPaint;
         private final Paint mPaint;
         private final Paint mTargetPaint;
         private final Paint mPathPaint;
         private final FontMetricsInt mTextMetrics = new FontMetricsInt
 ();
         private int mHeaderBottom;
         private boolean mCurDown;
         private int mCurNumPointers;
         private int mMaxNumPointers;
         private final ArrayListPointerState mPointers
                  = new ArrayListPointerState();

         public MyView(Context c) {
             super(c);
             mVC = ViewConfiguration.get(c);
             mTextPaint = new Paint();
             mTextPaint.setAntiAlias(true);
             mTextPaint.setTextSize(10
                     * getResources().getDisplayMetrics().density);
             mTextPaint.setARGB(255, 0, 0, 0);
             mTextBackgroundPaint = new Paint();
             mTextBackgroundPaint.setAntiAlias(false);
             mTextBackgroundPaint.setARGB(128, 255, 255, 255);
             mTextLevelPaint = new Paint();
             mTextLevelPaint.setAntiAlias(false);
             mTextLevelPaint.setARGB(192, 255, 0, 0);
             mPaint = new Paint();
             mPaint.setAntiAlias(true);
             mPaint.setARGB(255, 255, 255, 255);
             mPaint.setStyle(Paint.Style.STROKE);
             mPaint.setStrokeWidth(2);
             mTargetPaint = new Paint();
             mTargetPaint.setAntiAlias(false);
             mTargetPaint.setARGB(255, 0, 0, 192);
             mPathPaint = new Paint();
             mPathPaint.setAntiAlias(false);
             mPathPaint.setARGB(255, 0, 96, 255);
             mPaint.setStyle(Paint.Style.STROKE);
             mPaint.setStrokeWidth(1);

             PointerState ps = new PointerState();
             ps.mVelocity = VelocityTracker.obtain();
             mPointers.add(ps);
         }

         @Override
         protected void onMeasure(int widthMeasureSpec, int
 heightMeasureSpec) {
             super.onMeasure(widthMeasureSpec, heightMeasureSpec);
             

[android-developers] How can i launch another another android application from the current Application?

2010-03-08 Thread sagare
Hi All,
 I have developed 2 android applications and what i want is a way
to launch my android application no2 from say my android application
no 1 can anyone plz guide me with this. And tell me the extact intent
i need to fire.

Thanks a lot,
Sagar

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Unable to start service Intent

2010-03-08 Thread Vinay S
Hello Everyone,

I have created a small util which is a service, I would like to reuse
this util in my future projects.

I have exported /src /gen folders to jar. I have skipped, /res folder
and AndroidManifest.xml files.

I have tried including this in my new app activity and reuse the
service. But I get the error message Unable to start service Intent
.

I have enclosed the Manifest XML and outline of my project.

My Questions are:

1. Have I exported the right files to JAR?
2. Any other information needs to be added in my AndroidManifest.XML
(in App, not in Service) to reuse the service provided by the JAR.

Can someone help me to point out where have I gone wrong?

Thanks in Advance,
Vinay


- Service manifest.xml  -

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.ere.SDKUtil  android:versionCode=1
android:versionName=1.0
application android:debuggable=true
service android:name=SDKUtil/service
receiver android:name=BootUpReceiver
android:permission=android.permission.RECEIVE_BOOT_COMPLETED
android:enabled=true/receiver
/application
uses-sdk android:minSdkVersion=3 /
uses-permission android:name=... /uses-permission
/manifest

- SDKUtil.java  -
package com.ere.SDKUtil;

All imports are here
public class SDKUtil extends Service {
public IBinder onBind(Intent intent) {
return null;
}

public void onCreate() {
  super.onCreate();
  // init the service here
  try {
 _startService();
  } catch (Exception e) {
  Log.d(Service, Start Service Failed : +e.toString() );
}
}

public void onDestroy() {
super.onDestroy();
_shutdownService();
}
}

/*--- Second App, which uses the Jar file created as
mentioned above -*/


AndroidManifest.xml-
 ?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
package=com.ere.SDKSampleApp
 android:versionCode=1 android:versionName=1.0
application android:icon=@drawable/icon android:label=@string/
app_name android:debuggable=true
activity android:name=.SDKSampleApp android:label=@string/
app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
/application
uses-sdk android:minSdkVersion=3 /
/manifest

--- SDKSampleApp.java
-
package com.ere.SDKSampleApp;

import com.ere.SDKUtil.SDKUtil;

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

outputView = (TextView) findViewById(R.id.output) ;
try {
   Intent intent = new Intent (this, SDKUtil.class) ;
   startService(intent) ;
   outputView.setText(R.string.header +\n\n Please
Wait...! \n\n Getting info... ) ;
} catch (Exception e) {
outputView.setText(R.string.header + \n\nError : +
e.toString()) ;
}
}
}

--

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Automate Google Maps on Android

2010-03-08 Thread Ben Miller
I posted a blog on test automation example of 'Google Maps' on android
emulator
http://auto-simple.blogspot.com/2010/03/automate-google-maps-on-android.html

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Change how ListView looks, Roller

2010-03-08 Thread Raphael
The final effect should look like the selection spinning roller in the
iPhone, like this:
http://androidguys.savina.net/Small_Roller.png

With a background, the ListView (numbers) and another PNG
(transparent) on top but not selectable for the gradient effect. Any
ideas?


On Mar 7, 8:28 pm, Matthew Patience matthewj.patie...@gmail.com
wrote:
 I am trying to create a roller so that the user can select the amount
 of money they'd like to bet. So I created a list view and then put a
 transparent png over top of it to make it look like a little more
 fancy. Although it seems when I put the png over top of the listview I
 can longer see the list. I know this may seem like a far fetched idea,
 but I'm not sure if there is a better way to go about this.

 Anyone know a way that I can create a rolling selector?

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

2010-03-08 Thread Natalie
Is it only possible for one object to access the microphone at a
time?  That is, could I simultaneously use an AudioRecord to do some
audio processing AND use a MediaRecorder to record the incoming audio?
Thanks!
Natalie Linnell

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

2010-03-08 Thread Paul
What is the event that tells me when the Android device is hooked up
to a power plug?  I need to know what to monitor to know when the
system goes from battery to charging and vice versa.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Detecting the usb device in Android

2010-03-08 Thread Rj
Hi,
Im a new to Android development and would like to know how to detect
the USB device in android and load the driver module for the same. I
want to use this for testing a USB wifi Connection. Please Let me know
the details if any of you have the same.

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] Done missing from soft keyboard on TYPE_TEXT_FLAG_MULTI_LINE

2010-03-08 Thread jb
Hi,

When I programmatically set a EditText to the following, the soft
keyboard has Done in the lower right:

int settings = EditorInfo.TYPE_CLASS_TEXT;
et.setInputType(settings);
et.setImeOptions(EditorInfo.IME_ACTION_DONE);

When I add TYPE_TEXT_FLAG_MULTI_LINE, the Done button is gone, and
replaced with an Enter key symbol.

int settings = EditorInfo.TYPE_CLASS_TEXT |
EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
et.setInputType(settings);
et.setImeOptions(EditorInfo.IME_ACTION_DONE);

Is this the expected action with a MULTI_LINE flag? How can I get the
Done button to display with MULTI-LINE

TIA,

jb

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] i want to replace portrait images from landscape images on configuration change

2010-03-08 Thread nomesh gaur
i m having images with their portrait and landscape view.

i want to replace portrait images with their landscape images
programmatically.

plz tell me can i 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] Launch built-in Messaging Activity

2010-03-08 Thread Prashant Adesara
Is it possible to start an activity from the built-in Messaging app

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

2010-03-08 Thread Altaf
hello,
I am developing and android application by I call web services.I have
researched the android platform but I haven't find anything regarding
this problem.I am looking for some generic process for calling web
services in android application.There are some solutions such
KSoap,but APIs are too much heavy for android application.

Regards

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] about working with kSoap

2010-03-08 Thread Alfury
Hi everyone


Im facing a problem using kSoap library; the issue is I want to use
web services using input parameters like this :

my_parameters_list
   user
 namestring/name
 idstring/id
 address
 streetstring/street
 postcodestring/postcode
 /address
   /user
   user
.. //n users
   /user

/my_parameters_list

Please, can anyone tell me the way to solve this using ksoap2?

I dont know how to deal with SoapObject, PropertyInfo and
AttributeInfo and I dont even know if it´s going to work, I mean the
use I want to give to ksoap; I would thank a lot a workaround! Ive
read a lot without no idea about solving this problem, at less, using
ksoap.

Regards

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] 3D (game) engines for Android

2010-03-08 Thread prefabSOFT
Hi all,

Are there any 3D game engines for Android worth looking at?

Would be nice if the http://www.jmonkeyengine.com to Android port
would succeed.

Kind regards,

Jochen

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] DateFormat of android for AM/PM is not working properly with android 2.0

2010-03-08 Thread Ritesh Deshmukh
Hi,

I have worked on android 1.5 and 2.0.

Currently i am doing Migration of Applications available in 1.5 to
android 2.0.

During the work time i have come up with one issue as follow:

The DateFormat of android is not returning the value in CAPITAL
Letters for AM/PM in 2.0 where as in 1.5 it is doing absolutely fine.


Example :::


package com.test.formatter;

import java.util.Calendar;
import java.util.Date;

import android.app.Activity;
import android.os.Bundle;
import android.text.format.DateFormat;
import android.widget.TextView;

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

TextView textView = (TextView) findViewById(R.id.textview);

String delegate = MM/dd/yy h:mm a;
Date noteTS = Calendar.getInstance().getTime();
textView.setText(Found Time :: + DateFormat.format(delegate,
noteTS));
}
}


Output ::--

1. With android 1.5
Found Time :: 03/08/10 4:12 PM

2. With android 2.0
Found Time :: 03/08/10 4:12 pm

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Error: Upload a valid APK.

2010-03-08 Thread Phazor
I recently joined the Android Market as a developer and whenever I try
to upload my .apk I only ever get this message: Upload a valid APK.
I don't know what's wrong with it, I used the export wizard from
Eclipse. Any help is appreciated.

On a side note, I'm currently seeing Your Registration to the Android
Market is still being processed. You can upload applications to the
Android Market but you cannot publish until your registration is
completed., can someone tell me how long that'll last?


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] what is the detailed relation between contacts and raw_contacts?

2010-03-08 Thread Jerome Deng
Hi,
Any one can help interpret the relation between the table contacts and
raw_contacts?Is it one-to-one or one-to-many relation?I am puzzled because
the SDK seems indicate it is one-to-many relation but after I checkout all
data from the database table,I found it is one-to-one relation.

And is there any detailed relation diagram describing  android database
tables?

Jerome
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: How can i show a prefilled contacts screen on android 2.0

2010-03-08 Thread sagare
Hi,
Android developers plz help me with this plz.

Thanks a lot,
Sagar

On Mar 5, 6:35 pm, sagare sagar.ekb...@gmail.com wrote:
 Hi All,

 I know the code below opens the native Edit/Add contact screen

 Intent newIntent = new Intent(Intent.ACTION_INSERT,
 ContactsContract.Contacts.CONTENT_URI);
 startActivityForResult(newIntent, 1);

 now i want this screen to be populated with some data in fields like
 name, phone number, address etc. I found that if i do something like
 newIntent.putExtra(ContactsContract.Intents.Insert.NAME,  Some
 Name);
 will show this screen with name Some Name being shown in the name
 field this is fine for me now i dont understand how will i fill the
 city, state and zip fields similarly.
                  I found the ContactsContract.Intents.Insert has a
 POSTAL attribute for address but there are no specific attributes for
 city, state and zip in ContactsContract.Intents.Insert.
                 Also i found that
 ContactsContract.CommonDataKinds.StructuredPostal has the city, state
 and zip attributes but still i dont know how can i use this to
 prepopulate the Edit/Add contact screen  with values of city, state
 and zip.

 Please Help me with this,
 Sagar

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] USB Wifi device detection and loading the driver for same

2010-03-08 Thread Rj
Hi,
I want to use the WiFi USB device by plugging in to the android
device. When i plugin the same i don't see any udev events. Would any
of you please tell me how to make the device to detect the USB and
load drivers for the same?

Thanks.
Rj

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Switching between tasks

2010-03-08 Thread Christian Erpelding
Hello everybody,

I'd like to create an Application that uses 2 Tasks with Activities.
Let's call the Tasks A and B and the activites A1, A2, ..., An and 
B1, B2, ... Bn. 

A1 and B1 should be the entry points of the two Tasks.
A1 is also be the entry point of the whole Application (i.e. 
A1=MAIN=LAUNCHER).

In the App, I would like to be able to switch between the 2 Tasks and 
the whole Activity stack of this task should be restored.

Let's say the user browses my App like this:

A1 - A2 - A3 
  (switch tasks)
B1 - B2 
  (switch tasks)
A3 (user presses BACK key) A2 
  (switch tasks)
B2

Is such a task switching supported by the Android API?

Thanks a lot in advance,
Christian Erpelding


pgpS6lGfVNl4Z.pgp
Description: PGP signature


[android-developers] Re: client certificate authentication for ssl/https connection

2010-03-08 Thread Pau Varela
hi,

did anyone find the problem? When I try to test locally the emulator i
got the same error. when browsing it's not a problem since a warning
is shown and you can skip the issue, but calling my local server
doesn't allow me to go further.

I've found a solution, without using HttpClient to connect, but
TrustManager, which consists on overwriting the
HostnameVerifier.verify() method, in order to return always a true,
but I'm not really sure this is the best way (although is just for
some local testing)..

thanks and regards,

pau.

On Feb 25, 5:37 am, Babasaheb babadam...@gmail.com wrote:
 Hi,

 Thanks for the reply.
 I tried your solution. But I got Untrusted Server Certificate
 error.
 I am trying to solve the error.

 Thanks and regards,


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Stopped unexpectedly on a real phone but not on the simulator

2010-03-08 Thread spachner
Hi,

the stack trace is the last output in logcat before the app dies. Use
adb -d logcat or in the Eclipse the Logcat output to look at the
traces.

regards

spachner

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Can I get sued for using Android Caller ID?? -Please answer

2010-03-08 Thread chris harper
Thank monmonja

I found and contacted a company that holds a patent on a feature that my app
centers around.

They are going to work with me and review my app before I launch it to
discuses license agreements. I let them know I am an individual who does
have tons of money to spend on licenses so I will be interested to see what
they propose.

-Chris

On Mon, Mar 8, 2010 at 9:16 AM, monmonja almondmend...@gmail.com wrote:

 First of all thanks for using my example :) On the patent thing, if
 you have a good idea similar to something that is patented, i suggest
 you to put your app on other country besides US or the list of
 countries that have the patent (you can google search them). One
 reason is that the patent system in US is kind of a mess right now
 (sorry guys its just is). Most patents in US are not global patents so
 in a sea of 140+ countries, there is a good chance your app would be
 big somewhere else. On the localization part, there are a lot of
 willing individual on that certain country that could speak english
 and is willing to translate the app for you. Btw im not a US hater but
 i hate the patent system there, it kills further innovations.

 On Mar 3, 12:51 am, chris harper ch393...@gmail.com wrote:
  I agree it all depends on if your app makes money. If they see something
  that makes money they will come after you if you violate a Patent. In my
  case I did my homework and found out now before my app goes out that
 someone
  holds a patent on any case when someone takes any graphic of any image
 that
  represents a head and places it on graphic of anything that represents a
  body. Like JibJab does. If you look at the legal part of their JibJab's
 web
  site they have to pay pixfusion a license fee (at the very bottom).
 
  http://sendables.jibjab.com/about/legal
 
  Which is what my app is going to do (take a head and place it on a body).
 
  I wrote pixfusion two emails asking about licenses fee's and what I was
  developing but I never heard back. So I'll keep the emails that I wrote
 and
  if (by chance) my app does get a little popular and I do hear from them
 then
  I will have proof that I tried contacting them and I was proactive.
 
  For any developers out there reading this do a little googling on any
  major features of your app and just aware that there are MANY patents out
  there. Where if your app takes off you could get an email from some BS
  company saying you have to pay them licenses fees and/or a cease and
 desist
  order like K05tik got.
 
  There is nothing worse for a developer then spending hours of time
  developing and coding something just to find out that they have to stop
  publishing it.
 
  Thanks
  -Chris
 
 
 
  On Tue, Mar 2, 2010 at 1:15 AM, ko5tik kpriblo...@yahoo.com wrote:
   In today society everybody  can sue you for almost anything at any
   time
   ( we live in kind of free countries, in unfree countrys you will be
   just thrown to jail  )
   in case of tetris applet they claimed copyright on 4-block tiles ;)
   ( which were used in a books back in 70ies )
 
   Software patents do suck,  as well as actual copyright laws  ( for
   example in germany,
   EUR 0.06 per blank CD goes straight to GEMA , as well as EUR 30 on
   every new
   PC sold, and they still claim that you download music illegally)  -
   so please support your
   local pirate party.
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   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.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.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] Activity restart crash after OS kills it

2010-03-08 Thread jgostylo
This is what I am doing:

Activity SplashScreen is the launching activity for my app.  It sends
a request to my server and gets back a user data it then uses to
populate a user object which is a static object.  Once it has that it
calls the MyMapView activity and finishes itself.

A force close occurs when I hit the home button and then open up
enough other apps so that Android kills MyMapView to get more
resources.  Now when I open my app again it tries to start MyMapView
and bypasses SplashScreen.  There is no user object so I get null
pointer exceptions.

I have tried to Override the onSaveInstanceState and
OnRestoreInstanceState but it seems that those are not available when
Android kills the activity.

I also tried android:finishOnTaskLaunch with the SplashScreen (maybe
this should be put on MyMapView but the article I read said different)
and that seems to have no effect.

What I would like is for the activity to not restart after Android has
killed it.  What can I do about this?

Thanks,
Jake

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Socket app- Worked fine in Java, not in Android

2010-03-08 Thread farmkid
Have run into a roadblock with this socket app.  It all worked fine in
Java with Eclipse, but when we moved it over to Android, it won't run.

When run on Android emulator (both 1.5 and 2.1), we get false(gave up
waiting on response)

The part that needs explaining is that after the NMEA sentence is
sent, we should get a data stream until we close the socket.

1. Why do we get false in the text box?  No clue on that one.
Hopefully it will give us a clue as to why it breaks.

2. And what might be different between straight Java and Android
sockets/programs or wrong with our code that we get this exception
instead of the data stream we get when just running as Java app?

See code below.  I have ed out sensitive info.  Thanks for any
help you can give.



package com.XXXmobile;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.InetSocketAddress;
import java.net.Socket;
import android.os.*;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class XXXmobile extends Activity {
/** Called when the activity is first created. */

// TODO: these will come from some sort of user-input box
private final String XCasterHost = 156.63.XXX.XXX;
private final int XCasterPort = 2101;
private final String XMountPoint = ODOT_RTCM3;
private final String XUsername = westX;
private final String XPassword = melX;
private final String Base64Credentials =
d2VuZmFyXXX;
private final String NEMASentence = $GPGGA,184500.00,4014.753,N,
08316.243,W,4,08,1.0,271.0,M,-33.391,M,,*51;
private TextView textBox;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
textBox = (TextView) findViewById(R.id.TextView01);
Connection();
}
public void Connection()
{
// create the socket
Socket sock = new Socket();
BufferedReader sockIn = null;
PrintWriter sockOut = null;
// TODO: do some parameter checking on the host name and port
InetSocketAddress CasterAddr = new
InetSocketAddress(CasterHost, CasterPort);
try {
sock.connect(CasterAddr);
sockIn = new BufferedReader(new
InputStreamReader(sock.getInputStream()));
sockOut = new PrintWriter(sock.getOutputStream(), true);
}
catch(IOException e)
{
// TODO: display some nice error message to the user
d(e.getMessage());
}

try
{
// send it!
sockOut.println(GET / + MountPoint +  HTTP/1.0);
sockOut.println(User-Agent:  MobileAndroid/);
sockOut.println(Accept: */*);
sockOut.println(Connection: close);
if(Base64Credentials.length()  0)
{
sockOut.println(Authorization: Basic  + 
Base64Credentials);
}
sockOut.println();

waitForResponse(sockIn, 1);

String response = ;
// get the response (looking for ICY 200 OK)
response = sockIn.readLine();
d(response);

if(response.contains(ICY 200 OK))
{
// get the extra blank line
sockIn.readLine();
CollectData(sockIn, sockOut);
}
else
{
throw new IOException(Didn't get ICY 200 OK);
}

sockOut.close();
sockIn.close();
sock.close();
}
catch(Exception e)
{
// TODO: display some nice error message to the user
d(e.getMessage());
}
}
public void CollectData(BufferedReader sockIn, PrintWriter
sockOut) throws IOException, InterruptedException
{
sockOut.println(NEMASentence);
sockOut.println();

waitForResponse(sockIn, 2);
// get the correction data
int i = 0;
while(sockIn.ready()  i  1)
{
d(sockIn.readLine());
i++;
}
}
public void waitForResponse(BufferedReader sockIn, int j) throws
IOException, InterruptedException
{
// hang out and wait for something back
for(int i=0; i  300; i++)
{
if(!sockIn.ready())
{
Thread.sleep(100);
}
else
{
break;
}
}

[android-developers] Re: Can I get sued for using Android Caller ID?? -Please answer

2010-03-08 Thread Yahel
Hey Chris,

Smart move, but depending on the time spent and the work involved you
should ask them for the minimum fee they'll ask you.

Would be too bad to create an app around there patent, give them nice
implementation ideas, and have them just tell you they won't let you
because they are doing the same, or asks for $400 000

Yahel

On 8 mar, 18:59, chris harper ch393...@gmail.com wrote:
 Thank monmonja

 I found and contacted a company that holds a patent on a feature that my app
 centers around.

 They are going to work with me and review my app before I launch it to
 discuses license agreements. I let them know I am an individual who does
 have tons of money to spend on licenses so I will be interested to see what
 they propose.

 -Chris



 On Mon, Mar 8, 2010 at 9:16 AM, monmonja almondmend...@gmail.com wrote:
  First of all thanks for using my example :) On the patent thing, if
  you have a good idea similar to something that is patented, i suggest
  you to put your app on other country besides US or the list of
  countries that have the patent (you can google search them). One
  reason is that the patent system in US is kind of a mess right now
  (sorry guys its just is). Most patents in US are not global patents so
  in a sea of 140+ countries, there is a good chance your app would be
  big somewhere else. On the localization part, there are a lot of
  willing individual on that certain country that could speak english
  and is willing to translate the app for you. Btw im not a US hater but
  i hate the patent system there, it kills further innovations.

  On Mar 3, 12:51 am, chris harper ch393...@gmail.com wrote:
   I agree it all depends on if your app makes money. If they see something
   that makes money they will come after you if you violate a Patent. In my
   case I did my homework and found out now before my app goes out that
  someone
   holds a patent on any case when someone takes any graphic of any image
  that
   represents a head and places it on graphic of anything that represents a
   body. Like JibJab does. If you look at the legal part of their JibJab's
  web
   site they have to pay pixfusion a license fee (at the very bottom).

  http://sendables.jibjab.com/about/legal

   Which is what my app is going to do (take a head and place it on a body).

   I wrote pixfusion two emails asking about licenses fee's and what I was
   developing but I never heard back. So I'll keep the emails that I wrote
  and
   if (by chance) my app does get a little popular and I do hear from them
  then
   I will have proof that I tried contacting them and I was proactive.

   For any developers out there reading this do a little googling on any
   major features of your app and just aware that there are MANY patents out
   there. Where if your app takes off you could get an email from some BS
   company saying you have to pay them licenses fees and/or a cease and
  desist
   order like K05tik got.

   There is nothing worse for a developer then spending hours of time
   developing and coding something just to find out that they have to stop
   publishing it.

   Thanks
   -Chris

   On Tue, Mar 2, 2010 at 1:15 AM, ko5tik kpriblo...@yahoo.com wrote:
In today society everybody  can sue you for almost anything at any
time
( we live in kind of free countries, in unfree countrys you will be
just thrown to jail  )
in case of tetris applet they claimed copyright on 4-block tiles ;)
( which were used in a books back in 70ies )

Software patents do suck,  as well as actual copyright laws  ( for
example in germany,
EUR 0.06 per blank CD goes straight to GEMA , as well as EUR 30 on
every new
PC sold, and they still claim that you download music illegally)  -
so please support your
local pirate party.

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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.comandroid-developers%2Bunsubs
  cr...@googlegroups.com
For more options, visit this group at
   http://groups.google.com/group/android-developers?hl=en

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to

Re: [android-developers] What is the deal with the android: namespace?

2010-03-08 Thread Mark Murphy
sstrenn wrote:
 Is there any plan to eliminate the requirement to add the android:
 namespace to attributes in layout files?

There is no requirement to add the android: namespace to attributes in
layout files.

There *is* a requirement to add the
http://schemas.android.com/apk/res/android; namespace to your file and
use its associated prefix with attributes in layout files.

 And instead of adding value,
 they make the files VERY DIFFICULT TO READ AND EDIT.

This is your opinion.

 Is there any relief in sight?

Step #1: Open up a layout file in your favorite IDE or text editor

Step #2: Change the xmlns:android namespace declaration to use whatever
prefix you want, such as xmlns:a

Step #3: Change all occurrences of android: in that file to your
preferred prefix (e.g,. a:)

Step #4: Lather, rinse, repeat for all layout files you wish to modify

You might consider learning about XML namespaces, rather than
complaining about things you are perfectly capable of resolving yourself:

http://en.wikipedia.org/wiki/Xml_namespace

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

_The Busy Coder's Guide to Android Development_ Version 3.0
Available!

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


Re: [android-developers] Power event

2010-03-08 Thread Mark Murphy
Paul wrote:
 What is the event that tells me when the Android device is hooked up
 to a power plug? 

ACTION_BATTERY_CHANGED -- the extras will tell you the charging state
(AC, USB, not plugged in, etc.).

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

_The Busy Coder's Guide to Android Development_ Version 3.0
Available!

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


[android-developers] Re: Widget setOnClickPendingIntent not working

2010-03-08 Thread Kasra Rahjerdi
Good catch! Thank you. I've fixed this yet it has made no difference.
I can not even focus onto my widget and clicking it doesn't show any
highlight or anything either.

On Mar 8, 3:07 am, String sterling.ud...@googlemail.com wrote:
 On Mar 8, 4:20 am, Kasra Rahjerdi johncena4presid...@gmail.com
 wrote:

  when my widget is clicked
  nothing happens.

 Try changing your PendingIntent.getBroadcast() call to a
 getActivity(). If you're trying to start an activity, that would seem
 to make more sense - and that's what works for my appwidgets.

 String

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 restart crash after OS kills it

2010-03-08 Thread Mark Murphy
jgostylo wrote:
 This is what I am doing:
 
 Activity SplashScreen is the launching activity for my app.  It sends
 a request to my server and gets back a user data it then uses to
 populate a user object which is a static object.  Once it has that it
 calls the MyMapView activity and finishes itself.
 
 A force close occurs when I hit the home button and then open up
 enough other apps so that Android kills MyMapView to get more
 resources.  Now when I open my app again it tries to start MyMapView
 and bypasses SplashScreen.  There is no user object so I get null
 pointer exceptions.
 
 I have tried to Override the onSaveInstanceState and
 OnRestoreInstanceState but it seems that those are not available when
 Android kills the activity.

No, but onSaveInstanceState() will be called in and around the onPause()
and onStop() calls, so they most definitely will have been called by the
time your process is terminated, given your above scenario.

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

_The Busy Coder's Guide to Android Development_ Version 3.0
Available!

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


  1   2   >