[android-developers] Re: how to use AsyncTask

2012-02-01 Thread madlymad
here is a good example of Asynctask usage!

http://www.androidsnippets.com/grab-a-url-source-with-progressdialog-and-asynctask

On Jan 31, 3:24 pm, aashutosh aashutosh.andr...@gmail.com wrote:
 Hello,

 How can i use Asynctask for the following code:

 public static String getXML()  {

                         String line = null;

                         DefaultHttpClient httpClient = new 
 DefaultHttpClient();
                         HttpPost httpPost = new 
 HttpPost(http://someurl/index.xml;);
                         try {
                         HttpResponse httpResponse = 
 httpClient.execute(httpPost);
                         HttpEntity httpEntity = httpResponse.getEntity();
                         line = EntityUtils.toString(httpEntity);

                 } catch (UnsupportedEncodingException e) {
                         line = results status=\error\msgCan't connect 
 to server/
 msg/results;
                 } catch (MalformedURLException e) {
                         line = results status=\error\msgCan't connect 
 to server/
 msg/results;
                 } catch (IOException e) {
                         line = results status=\error\msgCan't connect 
 to server/
 msg/results;
                 }

                 return line;

                 }

 this basicaly gets an xml from the website

 Thanks in advance

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


[android-developers] Re: nullpointer on getPreferenceManager() in sdk 13 and up

2012-02-01 Thread Dirk Vranckaert
Thank Mark, that did indeed help!

On Jan 31, 3:37 pm, Mark Murphy mmur...@commonsware.com wrote:
 getPreferenceManager() looks like it will return null if you are using
 preference headers. My guess is that you are supposed to use the
 PreferenceManager from your PreferenceFragments.

 On Tue, Jan 31, 2012 at 9:22 AM, Dirk Vranckaert









 dirkvrancka...@gmail.com wrote:
  I'm trying to implement a fragemented preferences activity.

  This is only the first part of my activity where it already fails:

  public class PreferencesICSActivity extends PreferenceActivity {
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         PreferenceManager preferenceManager =
  PreferencesICSActivity.this.getPreferenceManager();

  preferenceManager.setSharedPreferencesName(Constants.Preferences.PREFERENCE 
  S_NAME);
     }
  ...
  }

  I used to do the same in sdk version 7, there it worked. Now however
  the getPreferenceManager() is null...
  What am I doing wrong?

  Kr,

  Dirk Vranckaert

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

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

 _The Busy Coder's Guide to Android Development_ Version 3.7 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] bulk install apps via android market

2012-02-01 Thread madlymad
Hi,

I would like to create an application (for not rooted devices) that
will make ti easy for the user to install a group of market
applications in a single click (or as less clicks as possible) is that
possible?

The only way that I could think of is to create a list of the apps and
clicking each one going to market://details?id=package_name but
still that is not so convenient, so I am looking if there is a way to
check all wanted apps and then enqueue them in order to download one
after the other (user accepting terms may also exist if you cannot
avoid them).

Any idea for achieving this is also welcome, 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] WCF WebService and Android problem with Complex Types

2012-02-01 Thread chankly
Hi Guys !!

First... sorry by my english, i am spanish...

I have a android application which is connecting with a WCF
Service .NET using KSOAP2.

My client Android connect with the service OK. And my client can send
a complex data type and receive this.

The problem is in the server (Ok, i dont know if my problem is of .NET
or Android, but i am desesperate). The server recive my Complex Type,
but can't read the properties... it look arrive null.

However, the server re-send this object with properties changed, and
this new value YES arrive to my client android. :S

Why my server can not read the properties ??

The SOAP send to my WCF is this:
v:Envelope xmlns:i=http://www.w3.org/2001/XMLSchema-instance;
xmlns:d=http://www.w3.org/2001/XMLSchema; xmlns:c=http://
schemas.xmlsoap.org/soap/encoding/ xmlns:v=http://
schemas.xmlsoap.org/soap/envelope/v:Header /
v:BodyGetDataUsingDataContract xmlns=http://tempuri.org/; id=o0
c:root=1composite i:type=n0:CompositeType xmlns:n0=http://
schemas.datacontract.org/2004/07/TicketoWSBoolValue
i:type=d:booleantrue/BoolValueStringValue
i:type=d:stringProbando/StringValue/composite/
GetDataUsingDataContract/v:Body/v:Envelope


The Response in my client android is this:
s:Envelope xmlns:s=http://schemas.xmlsoap.org/soap/
envelope/s:BodyGetDataUsingDataContractResponse xmlns=http://
tempuri.org/GetDataUsingDataContractResult xmlns:a=http://
schemas.datacontract.org/2004/07/TicketoWS xmlns:i=http://www.w3.org/
2001/XMLSchema-instancea:BoolValuefalse/
a:BoolValuea:StringValuedata from server/a:StringValue/
GetDataUsingDataContractResult/GetDataUsingDataContractResponse/
s:Body/s:Envelope


Thanks all people for your time.

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

2012-02-01 Thread Dirk Vranckaert
Currently for my 2.x preference screens, in every PreferenceActivity I
add the line `setContentView(R.layout.activity_preferences);` to have
a custom layout in my activities.

The activity_preferences.xml layout file looks like this:

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

LinearLayout style=@style/TitleBar
ImageButton style=@style/TitleBarAction
android:src=@drawable/ic_title_home
android:onClick=onHomeClick /

ImageView style=@style/TitleBarSeparator /
eu.vranckaert.worktime.utils.view.CustomTextView
style=@style/TitleBarText android:text=@string/
lbl_preferences_title/
/LinearLayout

ListView android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:id=@android:id/list/

/LinearLayout

For my 3.x and up application I am building the preferences according
to the example over here: 
http://developer.android.com/reference/android/preference/PreferenceActivity.html.

In order to apply the same layout to my 3.x app, I tried was to add
the `setContentView(..)` in the 3.x PreferenceActivity.

Result on phone: this works fine on the first activity, then when
loading a fragment (with the real preferences in them) my style is not
applied

Result on tablet: crash:

ERROR/AndroidRuntime(2208): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity
ComponentInfo{eu.vranckaert.worktime/
eu.vranckaert.worktime.activities.preferences.PreferencesICSActivity}:
java.lang.IllegalArgumentException: No view found for id 0x10202d4 for
fragment TimeRegistrationsPreferencesFragment{4101ed38 #0
id=0x10202d4}
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1956)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1981)
at android.app.ActivityThread.access$600(ActivityThread.java:
123)
at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: No view found
for id 0x10202d4 for fragment
TimeRegistrationsPreferencesFragment{4101ed38 #0 id=0x10202d4}
at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:822)
at
android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
at android.app.BackStackRecord.run(BackStackRecord.java:622)
at
android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:
1382)
at android.app.Activity.performStart(Activity.java:4474)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1929)
... 11 more

When I try to apply the layout file on my fragments using
`getActivity().setContentView(R.layout.activity_preferences);` the
result is:
for phone: the activity is still shown fine, when going into a
category it crashes:

ERROR/AndroidRuntime(1320): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity
ComponentInfo{eu.vranckaert.worktime/
eu.vranckaert.worktime.activities.preferences.PreferencesICSActivity}:
java.lang.IllegalArgumentException: No view found for id 0x10202d4 for
fragment DateTimePreferencesFragment{412a0d78 #0 id=0x10202d4}
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1956)
at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1981)
at android.app.ActivityThread.access$600(ActivityThread.java:
123)
at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: No view found
for id 0x10202d4 for fragment
TimeRegistrationsPreferencesFragment{412a0d78 #0 id=0x10202d4}

[android-developers] What do these errors mean (using Eclipse)?

2012-02-01 Thread atcal
I'm trying to define my own View subclass.

public class myView extends View {

myView(Context context) {
View(context);
}
}

Eclipse flags the first line of my constructor with an error Implicit
super conctructor View() is undefined. Must explicitly invoke another
constructor and the second line is flagged with the error The method
View(Context context) is undefined for the type myView.

What does all this mean? The android documentation shows the
constructor View(Context context) as public. Why can't I use it?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] What do these errors mean (using Eclipse)?

2012-02-01 Thread sourabh sahu
I think you should write super(context)

Sourabh

On Wed, Feb 1, 2012 at 2:41 PM, atcal alan.williams...@ya.com wrote:

 I'm trying to define my own View subclass.

 public class myView extends View {

myView(Context context) {
View(context);
}
 }

 Eclipse flags the first line of my constructor with an error Implicit
 super conctructor View() is undefined. Must explicitly invoke another
 constructor and the second line is flagged with the error The method
 View(Context context) is undefined for the type myView.

 What does all this mean? The android documentation shows the
 constructor View(Context context) as public. Why can't I use it?

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


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

[android-developers] running UI thread with AppWidgetProvider class

2012-02-01 Thread surabhi jain
hii

I am creating a widget (AppWidget) on Home Screen of device.

On widget I am showing image on run time.

I want to run UI thread with widget without using activity class.

Plz help me.

Thanks to All

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

[android-developers] Chat Application

2012-02-01 Thread Ganesh
Hello All,

I am  working on an application and wish to include chat option in it.
My application contains a friend list. I wish to see who among my
friends are online and chat with them.
I want to create my own chat application and DON'T want to include any
other pre-developed chat application like facebook.
I don't have much of information for the same.
can anyone please provide me with some guidance

Thanking you in advance.

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


[android-developers] Re: Bluetooth Socket over a TCP-Socket

2012-02-01 Thread Daimoe


On Jan 30, 2:10 pm, Daimoe rudel.dimi...@googlemail.com wrote:
 Hi

 My task is do develop a Android app which is able to connect to a
 other device via Bluetooth and communicate with the TCP Socket there.
 At the other Device there are a Socket Server written in c# (TCP
 Socket).

 I can connect to the Bluetooth socket.
 But if i try to connect to the TCP Socket after i am connected via
 Bluetooth like  Socket s = new Socket(hostname,port)
 The host is unknown.

 New*

 I should join the network via PAN profile , but there is no PAN for
Android.

Is there another way to emulate a ethernet connection via Bluetooth to
connect to my no serial socket?

 I hope u understand what the problem is and can help me.

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

2012-02-01 Thread kampy
hi

can we over ride the default android menu
i.e., can we add our specific other items to the menu provided by them
like adding posting the image to facebook after taking a picture using
cam .

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


[android-developers] Problem Creating new Contact with photo

2012-02-01 Thread Gorka
Hi,

I am trying to create a new Contact with a photo, but my code doesn´t
work properly. The thing is that the first time I execute the code the
new contact doesn´t appear on the Contacts List, but the second time I
execute it the contact appears twice and properly. I have tried the
same code but omitting the section that includes the photo and the
contact appears on the contact list fine the first time I try, so the
problem must be related to the photo inclusion.

I cannot understand why the first execution doesn´t work and the
second one does. As I said, when I create the contact for the second
time the new entrance appears twice on the contact list, with the
contact´s name, photo, and everything, so I guess the problem should
not be on the encoding.

I hope someone can help me.
Thanks a lot for yout time.

Here is my code:

..

// Get the Contact´s Picture
int id =
cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.PHOTO_ID));
Uri photoUri =
ContentUris.withAppendedId(ContactsContract.Data.CONTENT_URI, id);
Cursor c = getContentResolver().query(photoUri, new String[]
{ContactsContract.CommonDataKinds.Photo.PHOTO}, null, null, null);

byte[] photoBytes = null;
if (c.moveToFirst()) {
photoBytes = c.getBlob(0);

..

protected void createNewContact(String name, String mobileNumber,
String emailAddress, byte[] photo) {
ArrayListContentProviderOperation ops = new
ArrayListContentProviderOperation();

ops.add(ContentProviderOperation.newInsert(
ContactsContract.RawContacts.CONTENT_URI)
.withValue(ContactsContract.RawContacts.ACCOUNT_TYPE, null)
.withValue(ContactsContract.RawContacts.ACCOUNT_NAME, null)
.build());

//-- Names
if(name != null)
{
ops.add(ContentProviderOperation.newInsert(
ContactsContract.Data.CONTENT_URI)
 
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
0)
.withValue(ContactsContract.Data.MIMETYPE,
 
ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE)
.withValue(
 
ContactsContract.CommonDataKinds.StructuredName.DISPLAY_NAME,
name).build()
);
}

//-- Mobile
Number
...

//-- Email


//-- Photo
if(photo != null)
{
 
ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI)
 
.withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID,
0)
 .withValue(ContactsContract.Data.MIMETYPE,
ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE)
 .withValue(ContactsContract.CommonDataKinds.Photo.DATA15,
photo)
 .build());
}

// Asking the Contact provider to create a new
contact
try
{
ContentProviderResult[] result =
getContentResolver().applyBatch(ContactsContract.AUTHORITY,
ops);
}
catch (Exception e)
{
e.printStackTrace();
Log.d(TAG, Exception:  + e.getMessage());
}

Toast.makeText(TraspasoActivity.this, New Contact  + name +
 created !!, Toast.LENGTH_SHORT).show();
}

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

2012-02-01 Thread Vivek Malavade
Hi,
I have string, that length greater than 4000.
And i change the setting tts engine as pitch value , speech rate.
Whenever string length greater that 4000, tts engine starts and reading at 
its default setting(i mean pitch, speech rate values).
If there is string which has length less than 4000, my values are set 
(pitch value and speech rate).
Can anybody tell me what exactly solution for this.
 
Thanx 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] Problems with the width of the bitmap. The width is limited by the height of the screen

2012-02-01 Thread saex
Hi

I'm creating a bitmap wich i need to use as background of a 320 width
screen. The problem is that the bitmap is not getting the width i
want. It is getting two empty spaces on the left and on the right. It
is because it is fitting the height of the screen, but i dont want
that, i want to force the bitmap to have the width i want. Doesn't
matter if a portion of the height of the bitmap is out of the screen.

i need to force the width when i am adding the image to the layout, i
mean that the image must be keep the aspect ratio, but the image must
be higher than the height of the screen, and the image must be shown
incomplete if the heigh of the image is higher than the height of the
screen. Now this is not happening, because the layout is forcing the
width to respect the image and show all the height of the image in the
height of the screen, then i think the problem is on the layout rules

im creating the bitmap with:

View view;
Bitmap aux = Util.loadImage( filename ); //image loaded but with his
original width
Bitmap image = Util.scaleBitmap(aux, 320); //scaling to 320
((ImageView)view).setImageBitmap( resource.image );

RelativeLayout.LayoutParams rlp = new
RelativeLayout.LayoutParams( 320 , h );
rlp.addRule( RelativeLayout.CENTER_HORIZONTAL );
rlp.addRule( RelativeLayout.ALIGN_PARENT_TOP );

layout.addView( view , rlp );

What am i doing wrong?

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

2012-02-01 Thread Narendra Bagade
Hello all,

How to exit from application.

-- 
Regards,
Narendra
.

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

2012-02-01 Thread unicus unicus
Narendra,

please check my blog post.
http://androidbasic-answer.blogspot.in/2012/02/how-to-exit-from-android-application.html


-- 
*More info*,
http://androidbasic-answer.blogspot.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] bulk install apps via android market

2012-02-01 Thread Mark Murphy
On Wed, Feb 1, 2012 at 3:41 AM, madlymad mando7s...@gmail.com wrote:
 I would like to create an application (for not rooted devices) that
 will make ti easy for the user to install a group of market
 applications in a single click (or as less clicks as possible) is that
 possible?

Not really.

 The only way that I could think of is to create a list of the apps and
 clicking each one going to market://details?id=package_name

That is all you will be able to do.

 but
 still that is not so convenient, so I am looking if there is a way to
 check all wanted apps and then enqueue them in order to download one
 after the other (user accepting terms may also exist if you cannot
 avoid them).

No, sorry.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
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: how to use AsyncTask

2012-02-01 Thread Farhan Tariq
One consideration though, if i am not wrong, AsyncTasks need to be executed
from the UIThread.

Regarding your code, put the part in which the HTTP Request is sent and the
response is got in line in the doInBackground method of the AsyncTask
so that it runs on the background thread and does not block any execution
on the UIThread, and in postExecute method, return  'line' and process is
as you may

On Wed, Feb 1, 2012 at 1:14 PM, madlymad mando7s...@gmail.com wrote:

 here is a good example of Asynctask usage!


 http://www.androidsnippets.com/grab-a-url-source-with-progressdialog-and-asynctask

 On Jan 31, 3:24 pm, aashutosh aashutosh.andr...@gmail.com wrote:
  Hello,
 
  How can i use Asynctask for the following code:
 
  public static String getXML()  {
 
  String line = null;
 
  DefaultHttpClient httpClient = new
 DefaultHttpClient();
  HttpPost httpPost = new HttpPost(
 http://someurl/index.xml;);
  try {
  HttpResponse httpResponse =
 httpClient.execute(httpPost);
  HttpEntity httpEntity = httpResponse.getEntity();
  line = EntityUtils.toString(httpEntity);
 
  } catch (UnsupportedEncodingException e) {
  line = results status=\error\msgCan't
 connect to server/
  msg/results;
  } catch (MalformedURLException e) {
  line = results status=\error\msgCan't
 connect to server/
  msg/results;
  } catch (IOException e) {
  line = results status=\error\msgCan't
 connect to server/
  msg/results;
  }
 
  return line;
 
  }
 
  this basicaly gets an xml from the website
 
  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


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

2012-02-01 Thread Farhan Tariq
Logcat error trace might get you some help :)

On Wed, Feb 1, 2012 at 12:22 PM, ANKUR GOEL ankur1...@gmail.com wrote:

 Hi all ,

 sometimes i am getting video cannot be played err (100 , 0)

 can some body tell the exact reason and the solution for this problem

 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

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

2012-02-01 Thread androidmediadeveloper
For the reinstall check, we've used a shared preference. If
prefexists, dont check, if pref missing then check the market.

Another kludge would be to use the sqlite db version

Just my 2 cents

On Feb 1, 2:03 am, Zsolt Vasvari zvasv...@gmail.com wrote:
  Which kind of defeats the purpose of trying to have a single app.
  If you try to use IAB, you will get an error if it's not available, so
  why block the app from the Market? I guess they are just checking
  for the BILLING permission to filter, but still, why not let people
  use the free app.

 It's clearly politics.  Why not let people from Taiwan and PRC buy
 apps in the first place?  1+ billion potential customers.  So it's
 politics.

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

2012-02-01 Thread Farhan Tariq
try adding 'padding' to grid cells

2012/1/31 John Davis davi...@gmail.com

 Hello

 I am still having a problem with gridview and spacing.  Would love to talk
 to someone regarding the issue.  I've considered chaning text orientation
 for column headings or using two line text.

 Here is more info including screenshots:

 http://netskink.blogspot.com/2012/01/gridview-take2-issues.html


 --
 John F. Davis

 独树一帜



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

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

[android-developers] Re: In-App Billing Tracking By Android Market

2012-02-01 Thread beachboy
When user logs into Android Market to see the list of apps installed,
Will he see my Lite App is installed which was the original install or
will he see that in addition to the Lite app that he has also
purchased a license for advanced functions which is not the same as
the Paid App.

On Jan 31, 9:30 pm, TreKing treking...@gmail.com wrote:
 On Tue, Jan 31, 2012 at 5:49 PM, beachboy jfma...@gmail.com wrote:
  I assume then that during an uninstall and reinstall of the Lite
  version that my app will have to check the market to see if the user
  had previously purchased the advanced capabilities

 Right.

  and then unlock those during the install.

 No. You can't do anything during the install. You check when you run.

  It still seems like the user is misinformed as to which version of the app
  he is using from a market perspective.

 I don't know what you mean.

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

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

2012-02-01 Thread Farhan Tariq
Between your phone and the phone whose location you want to track, how do
you communicate?
You could have that phone update his location (via a location service) to a
web server, and you can pull that location every few seconds to show it on
your phone

On Tue, Jan 31, 2012 at 1:54 PM, Omollo Ateng omollo.at...@gmail.comwrote:

 i want to monitor another phone number's location, which listeners should
 i use?

 --
 Be good to not only people but also machines

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

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

[android-developers] Uploading paid android app on Android market

2012-02-01 Thread gauri
Hello,

I have finished with my game app for android. I want to upload it on
Android market as paid app. I am having my android market account.
When user installs my game, he must have to do registration for the
app and for that serial number is must. Is there any way in android
market for sending/providing information(like serial number) to such
user who has purchased the app? Or can we get any information of user
like email id for communicating with him?

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] Host USB/MTP Application

2012-02-01 Thread Baba Shanker
Is there any application available in Android Market that used USB/MTP
Api's? Can any one give information that will be useful for me in
making android MTP Application?

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

2012-02-01 Thread Farhan Tariq
Get each child of your tab widget, and see if there is anything you can do
to remove it

for(int i=0; itabWidget.getChildCount(); i++){
tabWidget.getChildAt(i).(ANYTHING YOU WANNA DO)
}

On Tue, Jan 31, 2012 at 11:08 AM, Ratheesh Valamchuzhy android...@gmail.com
 wrote:

 set the property of tab widget to  android:layout_marginBottom=-6dip

 it may work

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


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

Re: [android-developers] mini project

2012-02-01 Thread Farhan Tariq
youtube it for video guides

On Mon, Jan 30, 2012 at 9:41 PM, Mark Murphy mmur...@commonsware.comwrote:

 On Mon, Jan 30, 2012 at 12:58 AM, dany varghese gagip...@gmail.com
 wrote:
  how we can create a new application in android?
  please suggest required softwares for this purpose?

 http://developer.android.com

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

 _Android Programming Tutorials_ Version 4.1 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


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ExpandableListView How to get bitmap of each item separately

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 1:19 AM, Mansoor musafir4frie...@gmail.com wrote:

 My  group item layout/UI changes in expand and collapse state .

 How to get latest bitmap of corresponding group ?


Your adapter for the ExpandableListView tells it what views to use. So tell
it to use one view when collapsed and another when expanded.

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

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

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 7:07 AM, gauri gauri.v...@gmail.com wrote:

 When user installs my game, he must have to do registration for the app
 and for that serial number is must.


Um ... why? Do you not like to sell software?


 Is there any way in android market for sending/providing information(like
 serial number) to such user who has purchased the app?


You probably want the LVL.

Or can we get any information of user like email id for communicating with
 him?


Google Checkout has an email address you can use that forwards to the user.

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

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

2012-02-01 Thread Kostya Vasilyev

On 02/01/2012 05:02 PM, beachboy wrote:

When user logs into Android Market to see the list of apps installed,
Will he see my Lite App is installed which was the original install or


Assuming you mean when he opens the Market app on the device - Yes.


will he see that in addition to the Lite app that he has also
purchased a license for advanced functions which is not the same as
the Paid App.

No.

Last I checked, in-app purchases were not shown in the Market app - 
unlike regular app purchases, which show even if the app is not installed.


-- Kostya

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

2012-02-01 Thread Kostya Vasilyev

On 02/01/2012 05:40 PM, TreKing wrote:


Google Checkout has an email address you can use that forwards to the 
user.



No forwarding anymore - my order list has had direct user emails for a 
while now.


This is a good thing, because the forwarding service used to to mess up 
international characters in replies (I'd see it with Russian).





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


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

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 7:54 AM, Kostya Vasilyev kmans...@gmail.com wrote:

 No forwarding anymore - my order list has had direct user emails for a
 while now.


Oh, nice - haven't checked in a while. Dev console lets you filter ratings
and comments now too. Good stuff.

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

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

2012-02-01 Thread Kevin Courtney
Hello,

Can any of you guide me to some documentation for the Android/Google TV
YouTube player parameters?

I'm working in Java and bringing up the YouTube player on Android Devices
including Google TV.

Specifically I'm looking for playlist parameters but would welcome any type
of documentation.I've found various documents listing YouTube
parameters but they are generally ignored when running on Android devices.
  For the playlist, the first video will play but not the others.

Have any of you successfully used a playlist with the YouTube player?

Thanks in advance,

Kevin Courtney

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

2012-02-01 Thread Mark Murphy
On Wed, Feb 1, 2012 at 9:06 AM, Kevin Courtney kevinjcourt...@gmail.com wrote:
 Can any of you guide me to some documentation for the Android/Google TV
 YouTube player parameters?

I doubt there is any official documentation. Bear in mind that the
YouTube player is a proprietary application, not part of the Android
Open Source Project. Hence, we don't even have
reverse-engineered-from-the-source-and-pray-it-does-not-change-ever
documentation.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
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] bulk install apps via android market

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 6:44 AM, Mark Murphy mmur...@commonsware.com wrote:

  but
  still that is not so convenient, so I am looking if there is a way to
  check all wanted apps and then enqueue them in order to download one
  after the other (user accepting terms may also exist if you cannot
  avoid them).

 No, sorry.


Actually, AppBrain seems capable of this - you can choose apps to install
via their site and it triggers an automatic install (no prompt) on the
device, just like the official Market site. I'm not seeing an option to
queue up a bunch of apps and bulk install, but I don't see why it wouldn't
be possible.

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

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

2012-02-01 Thread Ed Harned
This open source project supports a general purpose multi-threading
service:
http://coopsoft.com/ar/AndroidArticle.html

Ed

On Jan 31, 10:21 am, TreKing treking...@gmail.com wrote:
 On Tue, Jan 31, 2012 at 9:10 AM, ColletJb collet...@gmail.com wrote:
  How could I handle the progress updates with a separated service ?
  With AIDL ?

 Check the Service documentation page. There is a LocalService example.

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

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

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 1:38 AM, Anuj Goyal anuj.go...@gmail.com wrote:

 I have yet to see a webpage that nicely details the performance
 implications of using an Alarm vs. a Service.


These are two mutually exclusive APIs that are frequently, but not
necessarily, used in conjunction.
Alarm = Schedule some action to occur at a specified time (broadcast event,
start service, etc).
Service = Execute some action in the background (ex: sync app with the
cloud).

If you need to ensure your alarm continues to be set and repeating after a
reboot, you would do as Kris already suggested. A Service would not be
required for that.

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

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

2012-02-01 Thread Dave
How do I get the Selector highlighting functionality in an
AdapterView?

I cannot do:
android:listSelector=@drawable/myadapterview_background

like in a gridview, because android:listSelector is not there.

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

2012-02-01 Thread Mark Murphy
On Wed, Feb 1, 2012 at 9:18 AM, TreKing treking...@gmail.com wrote:
 On Wed, Feb 1, 2012 at 6:44 AM, Mark Murphy mmur...@commonsware.com wrote:

  but
  still that is not so convenient, so I am looking if there is a way to
  check all wanted apps and then enqueue them in order to download one
  after the other (user accepting terms may also exist if you cannot
  avoid them).

 No, sorry.

 Actually, AppBrain seems capable of this - you can choose apps to install
 via their site and it triggers an automatic install (no prompt) on the
 device, just like the official Market site. I'm not seeing an option to
 queue up a bunch of apps and bulk install, but I don't see why it wouldn't
 be possible.

They are exploiting security holes in the Android Market, then. This
is not advisable.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
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] What do these errors mean (using Eclipse)?

2012-02-01 Thread Ted Scott

On 2/1/2012 4:11 AM, atcal wrote:

I'm trying to define my own View subclass.

public class myView extends View {

 myView(Context context) {
 View(context);
 }
}

Eclipse flags the first line of my constructor with an error Implicit
super conctructor View() is undefined. Must explicitly invoke another
constructor and the second line is flagged with the error The method
View(Context context) is undefined for the type myView.

What does all this mean? The android documentation shows the
constructor View(Context context) as public. Why can't I use it?


There are several reasons why View() is not available and will never be 
available.


It means you don't understand class instantiation and the life cycle of 
a class. This is not an Android issue at all and I suggest that you 
spend some time learning Java fundamentals. These folks are generally 
pretty helpful with that http://www.javaranch.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] Use javascript to get web view selection.

2012-02-01 Thread tatebn
I need to run some javascript in an android web view. I understand
this works fine by loading a javascript: url. It seems that when I do
that though the selected text in the web view is cleared. The
javascript I'm running gets the range of the selected text, so I need
it to remain selected.  I have my web view set up to allow javascript.

How can I run the javascript without losing the selection?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Poll: how many of you use a backend service or roll your own

2012-02-01 Thread Todd Grigsby
just to throw in my 2 cents: DynamoDB is not restful.  it's RPC.
On Jan 29, 2012 9:25 PM, Kristopher Micinski krismicin...@gmail.com
wrote:

 On Sun, Jan 29, 2012 at 10:45 PM, Nikolay Elenkov
 nikolay.elen...@gmail.com wrote:
  On Mon, Jan 30, 2012 at 11:46 AM, Kristopher Micinski
  krismicin...@gmail.com wrote:
 
 
  Right, right.  I don't think that this is extremely Android specific,
  but I think that Android apps are much more likely to do restful
  communication with a backend than standard apps.  Maybe this hasn't
  been your experience, but it's been mine.  (And that could just be
  because of the types of apps I write.)  Thanks for your input, though,
  I do suspect that major apps all roll their own.
 
 
  Far from being major, but I use my own, running on App Engine.
  Not really a problem, just some extra work. Authentication can
  be tricky though, if you don't want to use Google accounts
  (which is easy, but a lot of people freak out when they see
  account related permissions on an app). If you only wanted to
  store files/unstructured data, using the Google Cloud storage
  (Google's S3) would probably be the easiest solution, no need
  for a dedicated frontend.
 

 Hey, thanks for telling me this!  I had never known of that perception
 before, and it's really good feedback!

  Amazon makes it fairly easy to use their services (S3, DynamoDB,
  etc), but you need to running a server just to get authentication tokens
  (Token Vending Machine), which is a pain (and potentially expensive).
  For example, you can store data directly in their DynamoDB, without
  needing to roll your own REST frontend:
 
  http://aws.amazon.com/articles/7439603059327617
 

 Cool!  Thanks for the links, I had heard of these before, but I hadn't
 investigated them too much.

  TVM:
  http://aws.amazon.com/articles/4611615499399490
 

 Thanks,

  And then there is https://www.parse.com/ which reportedly takes
  care of all this stuff for you, but I haven't actually used it.
 

 I keep wanting to use it to see what their service is like, so I
 signed up and am going to try it out for a while..

 kris

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

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

Re: [android-developers] overriding the default android menu

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 4:55 AM, kampy narasimha1...@gmail.com wrote:

 can we over ride the default android menu


No.


  i.e., can we add our specific other items to the menu provided by them


No.

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

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

[android-developers] Re: What do these errors mean (using Eclipse)?

2012-02-01 Thread atcal

On Feb 1, 4:25 pm, Ted Scott t...@hootinholler.com wrote:
 On 2/1/2012 4:11 AM, atcal wrote:





  I'm trying to define my own View subclass.

  public class myView extends View {

       myView(Context context) {
           View(context);
       }
  }

  Eclipse flags the first line of my constructor with an error Implicit
  super conctructor View() is undefined. Must explicitly invoke another
  constructor and the second line is flagged with the error The method
  View(Context context) is undefined for the type myView.

  What does all this mean? The android documentation shows the
  constructor View(Context context) as public. Why can't I use it?

 There are several reasons why View() is not available and will never be
 available.

 It means you don't understand class instantiation and the life cycle of
 a class. This is not an Android issue at all and I suggest that you
 spend some time learning Java fundamentals. These folks are generally
 pretty helpful with thathttp://www.javaranch.com/- Hide quoted text -

 - Show quoted text -

Ted,

Thanks. You are probably right. While I have 10 yrs experience of C++
with Windows and Java looks deceptively similar, things like this are
tripping me up. I do understand about classes and instantiating
objects but obviously not the peculiarities of Java. I've tried to
register at javaranch but the website is not fast at sending back the
registration activation email. I'll have to learn to be patient.

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

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 4:08 AM, Ganesh ganesh.som...@gmail.com wrote:

 can anyone please provide me with some guidance


www.google.com + make android chat app

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

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

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 4:08 AM, surabhi jain surabhi17.j...@gmail.comwrote:

 I want to run UI thread with widget without using activity class.


OK. And ... ?
http://www.catb.org/~esr/faqs/smart-questions.html

Plz help me.


Plz spell please correctly.

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Documentation for the Android/Google TV YouTube player parameters

2012-02-01 Thread Kevin Courtney
Hi Mark,

Thanks for the quick reply although that doesn't sound very
encouraging :-(

I've posted the same question to the YouTube grouphoping that
someone out there might have some clues for me.

Kevin


On Feb 1, 6:15 am, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Feb 1, 2012 at 9:06 AM, Kevin Courtney kevinjcourt...@gmail.com 
 wrote:
  Can any of you guide me to some documentation for the Android/Google TV
  YouTube player parameters?

 I doubt there is any official documentation. Bear in mind that the
 YouTube player is a proprietary application, not part of the Android
 Open Source Project. Hence, we don't even have
 reverse-engineered-from-the-source-and-pray-it-does-not-change-ever
 documentation.

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

 _The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
 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] sqlite databases and non-rooted phones

2012-02-01 Thread John Davis
Hello

I am writing an application which uses a sqlite database.  Previously I was
using a rooted phone to debug/develop this app.  My app does not have any
special permissions, sdcard, etc.

One thing I was doing when using a rooted phone was debugging the database
queries via adb shell.  I would get a shell on the phone and then open the
database and issue sql commands to assist me with my android api usage of
sql.

Now, I have switched to a new phone and it is not rooted.  Personally, I
want to keep this phone non-rooted, but I would like to continue using
direct sql queries to the database.

I've tried various things to work around this issue but none of them work.

I've tried to pull the database via adb pull command to work on a pc copy
of the database.  This does not work.  I have permission problems.
I've tried to do run-as net.skink.swtor.toontracker in order to run as
my application privilege to perform sql queries on the live database but
this does not work either.

Any suggestions on how to work on the database on a non-rooted phone?  I
would prefer to use the database on the phone rather than on a pc.

-- 
John F. Davis

独树一帜

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

2012-02-01 Thread ericharlow
I am posting this to determine if this is a bug I should file or my own 
operator error. Any input would be appreciated.

I was attempting to use a theme to change the background of all buttons in 
my application. 
Instead of using a 
StateListDrawablehttp://developer.android.com/reference/android/graphics/drawable/StateListDrawable.html
 I 
am trying a 
ColorStateListhttp://developer.android.com/reference/android/content/res/ColorStateList.html
. 

My theme is simply:
*?xml version=1.0 encoding=utf-8?*
*resources  *
*  style name=EarthToneTheme parent=CustomLightTheme*
*  item name=android:buttonStyle@style/EarthtoneButton/item*
*  !--  item 
name=android:listViewStyle@style/EarthtoneListView/item*
*  item name=android:tabWidgetStyle@style/EarthtoneTabWidget/item 
--*
*  /style*
*/resources*

My style is:
*?xml version=1.0 encoding=utf-8?*
*resources*
*style name=EarthtoneButton parent=android:Widget.Button*
*item 
name=android:background@color/button_selector_earthtone/item*
*!--  item 
name=android:background@color/earthtone_darkblue/item --*
*/style*
*/resources* 

My 
ColorStateListhttp://developer.android.com/reference/android/content/res/ColorStateList.html
 is 
in res/color/ and is:
*?xml version=1.0 encoding=utf-8?*
*selector xmlns:android=http://schemas.android.com/apk/res/android; *
*!-- Normal --*
*item android:state_window_focused=false android:state_enabled=true
*
*android:color=@color/earthtone_darkblue /*
*!-- Pressed --*
*item android:state_pressed=true *
*android:color=@color/earthtone_darkgreen /*
*!-- Selected --*
*item android:state_focused=true android:state_enabled=true*
*android:color=@color/earthtone_mediumgreen /*
**
*item android:state_window_focused=false 
android:state_enabled=false*
*android:color=@color/earthtone_lightgrey /*
*item android:state_enabled=true*
*android:color=@color/earthtone_darkblue /*
*item android:state_focused=true*
*android:color=@color/earthtone_mediumgreen /*
*item android:color=@color/earthtone_darkblue /*
*/selector*

Below is my sesson data and stack trace.

*Eclipse session data:*
eclipse.buildId=M20110909-1335
java.version=1.7.0_02
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product 
org.eclipse.epp.package.java.product

*Exception Stack Trace:*
org.xmlpull.v1.XmlPullParserException: Binary XML file line #5: item tag 
requires a 'drawable' attribute or child tag defining a drawable
at 
android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:167)
at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:787)
at android.graphics.drawable.Drawable.createFromXml(Drawable.java:728)
at 
com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:208)
at 
com.android.layoutlib.bridge.android.BridgeTypedArray.getDrawable(BridgeTypedArray.java:731)
at android.view.View.init(View.java:1885)
at android.widget.TextView.init(TextView.java:327)
at android.widget.Button.init(Button.java:108)
at android.widget.Button.init(Button.java:104)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
at 
com.android.layoutlib.bridge.android.BridgeInflater.onCreateView(BridgeInflater.java:84)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at 
com.android.layoutlib.bridge.android.BridgeInflater.createViewFromTag(BridgeInflater.java:129)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
at 
com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:279)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:318)
at 
com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:325)
at 
com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:372)
at 
com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1323)
at 
com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1077)
at 
com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ConfigListener.onThemeChange(GraphicalEditorPart.java:517)
at 

Re: [android-developers] Re: Poll: how many of you use a backend service or roll your own

2012-02-01 Thread Kristopher Micinski
On Wed, Feb 1, 2012 at 10:47 AM, Todd Grigsby tgrigsby...@gmail.com wrote:
 just to throw in my 2 cents: DynamoDB is not restful.  it's RPC.


Yup!  But you can think of RPC and rest doing something similarly
semantically.  This isn't to say they're in any way technologically
similar, there are clear reasons why both exist..  It was worth
noting, however.

kris

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

2012-02-01 Thread Kostya Vasilyev

On 02/01/2012 08:36 PM, John Davis wrote:
Any suggestions on how to work on the database on a non-rooted phone? 
 I would prefer to use the database on the phone rather than on a pc.


You can add code in the app to copy the database from the app's storage 
directory in internal memory to the memory card, then pull the file to 
the PC and examine.


This code can be in a separate app, if you so desire - you can access 
the main app's files by using a sharedUserId (not recommended for 
production use, but can be useful for debugging).


-- Kostya

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

2012-02-01 Thread John Davis
Hello Kostya Vasiyev,

Many thanks.  I see what you mean.  I could add an import/export command to
the app.  And in the final release, simply remove the import/export
capability.

John

On Wed, Feb 1, 2012 at 11:43 AM, Kostya Vasilyev kmans...@gmail.com wrote:

 On 02/01/2012 08:36 PM, John Davis wrote:

 Any suggestions on how to work on the database on a non-rooted phone?  I
 would prefer to use the database on the phone rather than on a pc.


 You can add code in the app to copy the database from the app's storage
 directory in internal memory to the memory card, then pull the file to the
 PC and examine.

 This code can be in a separate app, if you so desire - you can access the
 main app's files by using a sharedUserId (not recommended for production
 use, but can be useful for debugging).

 -- Kostya

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-developers@**googlegroups.comandroid-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=enhttp://groups.google.com/group/android-developers?hl=en




-- 
John F. Davis

独树一帜

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Need architecture guidance in reference to a social app

2012-02-01 Thread leftcont...@gmail.com

Thank you both for the clarification and that read on sms is
interesting .

On Feb 1, 12:07 am, Kristopher Micinski krismicin...@gmail.com
wrote:
  Question: How do i handle the exchange between the two devices.
  Am i going to need a server to accomplish this?

 The basic answer is: yes.  You *do* need a server to accomplish this.
 Having a backend solution is probably the most feasible path, and it's
 done the majority of the time.

 There are other ways, sms, bluetooth, email, etc...  But these aren't
 really as common as using a web backend.

 kris

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

2012-02-01 Thread Mark Murphy
2012/2/1 John Davis davi...@gmail.com:
 Many thanks.  I see what you mean.  I could add an import/export command to
 the app.  And in the final release, simply remove the import/export
 capability.

Or, name it backup/restore and leave it in as a feature.

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

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.4
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] login problem

2012-02-01 Thread Narendra Singh Rathore
On Sun, Jan 29, 2012 at 3:25 AM, arun kumar arun.kata...@gmail.com wrote:

 Hi

 in the first activity  am givning the uname and pass values in the
 intent...and get that data in the
 second activity


 String login = getIntent().getStringExtra(
 Username);  and this data login value i have to pass to the

 UsernamePasswordCredentials creds = *new*
 UsernamePasswordCredentials(

 login, logpass);   here how to place the login value in the
 credential..



 firstactivity:

 Intent intent = *new* Intent(getApplicationContext(),
 SecondScreen.*class*);

 intent.putExtra(Username, uname.getText().toString());
 System.*out*.println(username: + uname);
 intent.putExtra(Password, pass.getText().toString());
 System.*out*.println(password: + pass);
 startActivity(intent);



 Second Activity

 String login = getIntent().getStringExtra(
 Username);

 System.*out*.println(login entered:+login);

 String logpass = getIntent().getStringExtra(Password);

 System.*out*.println(password entered:+logpass);

 *try* {

 HttpClient httpclient =
 *new* DefaultHttpClient();

 UsernamePasswordCredentials creds =
 *new* UsernamePasswordCredentials(

 login, logpass);

 ((AbstractHttpClient) httpclient).getCredentialsProvider()

 .setCredentials(

 *new* AuthScope(AuthScope.*ANY_HOST*,

 AuthScope.
 *ANY_PORT*), creds);



ok, good, what the problem are you facing?

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

2012-02-01 Thread avi
I would really appreciate it if someone could help me with the below
problem

On Jan 27, 10:01 am, avi avinanku...@gmail.com wrote:
 All,

 I am trying to develop an UI based automation system and I was
 exploring AccessibilityEvent option in Monkey. Following are the steps
 that I did
 (i) Launched monkey server socket
 (ii) Opened Settings app (tried other on board apps as well)
 (iii) Created a client socket from host machine and connected to
 monkey's server
 (iv) Issued listviews command
 (v) I always get the response No accessibility event has occured yet

 Could you please let me know if I am missing something?

 Thanks,
 Avi

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


Re: [android-developers] Re: What do these errors mean (using Eclipse)?

2012-02-01 Thread Ted Scott

On 2/1/2012 11:01 AM, atcal wrote:

On Feb 1, 4:25 pm, Ted Scottt...@hootinholler.com  wrote:

On 2/1/2012 4:11 AM, atcal wrote:






I'm trying to define my own View subclass.
public class myView extends View {
  myView(Context context) {
  View(context);
  }
}
Eclipse flags the first line of my constructor with an error Implicit
super conctructor View() is undefined. Must explicitly invoke another
constructor and the second line is flagged with the error The method
View(Context context) is undefined for the type myView.
What does all this mean? The android documentation shows the
constructor View(Context context) as public. Why can't I use it?

There are several reasons why View() is not available and will never be
available.

It means you don't understand class instantiation and the life cycle of
a class. This is not an Android issue at all and I suggest that you
spend some time learning Java fundamentals. These folks are generally
pretty helpful with thathttp://www.javaranch.com/- Hide quoted text -

- Show quoted text -

Ted,

Thanks. You are probably right. While I have 10 yrs experience of C++
with Windows and Java looks deceptively similar, things like this are
tripping me up. I do understand about classes and instantiating
objects but obviously not the peculiarities of Java. I've tried to
register at javaranch but the website is not fast at sending back the
registration activation email. I'll have to learn to be patient.

I meant that they have tutorials and stuff. Since you have the syntax  
etc from c++ then maybe the O'Riely book Java in a Nutshell would be 
helpful. Oh, and you can forget the evil multiple inheritance and 
pointer stuff. ;)


Probably a little tedious for you, but there is this: 
http://docs.oracle.com/javase/tutorial/java/javaOO/index.html which 
lacks a bit of detail as to why, but does cover the how of fundamentals.




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

2012-02-01 Thread OldSkoolMark
I am looking at design alternatives for an app that needs to persist
data locally to a sqlite DB, and synchronize its contents with a
server in the cloud. I have the pdf, and have watched the excellent
presentation from IO 2010. All of the recommended patterns use
ContentProviders. The only client to this DB is my app, so I have no
real need for a ContentProvider, except that I would like to use the
SyncManager. I just came across
http://stackoverflow.com/questions/4649808/syncadapter-without-a-contentprovider
which suggests that you can provide a dummy content provider which
does nothing, and sync to whatever you like.

Is this possible? Robust?

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

2012-02-01 Thread malls
I don't see any interface of passing the keys to open secure element in the 
android code. I am not sure how many people claims that you need google 
Keys to open SecureElement. May be I am missing 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] Re: Questions about VpnService

2012-02-01 Thread mellery451


On Dec 20 2011, 1:13 pm, Lysandus imbroke...@gmail.com wrote:
 I have a couple questions aboutVpnService.
 Is theVpnServiceadded in 4.0 only for creating a vpn connection for
 your app, or does it make the vpn for all traffic on the device?  If
 it's all device traffic does that mean your app can analyze things
 like what websites the user is visiting?

 Can it be used to just add a new vpn to the device and not have the
 traffic go through your app?

 Thanks.

A VpnService implementation should receive all network traffic from
the device, not just your application traffic. For this reason, there
can only be ONE vpn active at a given time (either a custom impl using
VpnService OR one of the stock android legacy VPNs). The
ParcelFileDescriptor that you get in VpnService allows you to read/
write packets to/from the device. In theory you should be able to
inspect these packets and analyze.

As far as I know, custom VPN implementations using VpnService DO NOT
show-up in the standard VPN configuration settings on the device...and
you actually have to create the client UI code to activate your custom
VPN as well.

-Mike

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


[android-developers] Multiple APKs installed to the same location

2012-02-01 Thread BT
Can I create multiple .apk's that install ADDITIVELY to the same /data/
apps/MyApp location?

In my particular case I have add-on modules that are built as C++ NDK
share objects:  Feature1.so, Feature2.so, Feature3.so, etc.  I don't
know what these will be ahead of time and the user must be able to
selectively install only those features they want.

I'm pretty sure iOS does this with in-app purchases, but not sure how
to do it on Android?

Thanks,
BT

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

2012-02-01 Thread John Coryat
Different APK's will have different package names and be installed in 
different directories, so in short, the answer is no.

-John Coryat

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

[android-developers] onResume start a duplicated activity

2012-02-01 Thread leslie.karpati
Hi!

I'am writing an online radio streamer application. It's working very
well (activity-bind service-notificiation bar, ...etc), but
sometimes when I go back to the UI (ex.: click to the application icon
from the menu, when the service and the activity are already running -
 onResume) it's start a new/second/duplicated activity, but the old
one does't killed. For example: when I press key back after that it's
destroy the new activity and going to back to the old one, and I can
kill it too.

I put this code to the onResume:
Log.v(TAG, Activity onResume called. Context:+context);
and onlye when the problem is occured (stared the second activity
above the old one), I got a different contex id.

Where is the problem?

Thanks,
Leslie

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


[android-developers] Re: Adding custom enum states to an ImageButton

2012-02-01 Thread Nick
Bump

On Jan 20, 1:40 pm, Nick nick.vers...@gmail.com wrote:
 I have searched around and I found good examples on adding custom
 boolean states to a drawable but I am having issues adding a state
 that is a list of enums.  I am sure most of my problems lie within the
 onCreateDrawableState call so I have a few questions.

 1) Is the extraSpace param to onCreateDrawableState the number of
 additional int[] that I would like to add or the size of the int[]? So
 since I am just adding MODE I should just be increasing extraSpace by
 1 and not by MODE.length?
 2) I don't quite understand the mergeDrawableStates method.  If I put
 it in an IF statement I am getting what I expect, but I think I am
 just getting lucky.  I don't feel my IF check is correct.  My initial
 assumption was that I don't do a check and always call
 mergeDrawableStates but then the drawable never changes.  I have seen
 where if the extra state is a boolean then the if statement checks for
 that.  I don't quite know what to do about an enum.
 3) When I do get it working, my ic_button_a is drawn correctly.
 However every time when ic_button_c is getting drawn, ic_button_c is
 resized and stretch to fit the View which includes a background
 graphic that is larger than ic_button_c.  ic_button_a and ic_button_a
 are the same size.

 I have my custom view:
         com.pkg.CustomView
             android:background=@drawable/ic_button_bg
             android:src=@drawable/ic_button
             android:layout_height=wrap_content
             android:layout_width=wrap_content/

 which extends ImageButton.:
 public class CustomView extends ImageButton {

     private static final int[] MODE = {R.attr.mode};
     private int mMode = 1;

     @Override
     public int[] onCreateDrawableState(int extraSpace) {
         final int[] drawableState =
 super.onCreateDrawableState(extraSpace + 1);
         if (mMode != 0) {
             mergeDrawableStates(drawableState, MODE);
         }
         return drawableState;
     }

     public void setMode(int mode) {
         mMode = mode;
         refreshDrawableState();
     }

 }

 I am defining my modes here:
 resources
     declare-styleable name=CaptureButton
         attr name=mode
             enum name=a  value=0 /
             enum name=b  value=1 /
             enum name=c  value=2 /
             enum name=d  value=3 /
             enum name=e  value=4 /
             enum name=f   value=5 /
             enum name=g  value=6 /
             enum name=h  value=7 /
         /attr
     /declare-styleable
 /resources

 My @drawable/ic_button is:
 selector xmlns:android=http://schemas.android.com/apk/res/android;
     xmlns:app=http://schemas.android.com/apk/res/com.pkg;
     item app:mode=c  android:drawable=@drawable/ic_button_c /

     item android:drawable=@drawable/ic_button_a /
 /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


Re: [android-developers] onResume start a duplicated activity

2012-02-01 Thread Kostya Vasilyev

Is the app originally launched from Eclipse?

If so, beware that Eclipse uses a different intent than would normally 
be used by the Launcher(s), so you may get duplicates like this.


To get a good test, either don't launch from Eclipse, or first press 
Back to close the initial activity, start a new one from Launcher, then 
test your notifications.


Other than that, here is what I use for widgets / notifications.

It matches the intent used by Launcher(s), and so resumes an existing 
activity if there is one:


Intent baseIntent = new Intent(context,  ACTIVITY CLASS 
HERE .class);

baseIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
baseIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
baseIntent.setAction(Intent.ACTION_MAIN);
baseIntent.addCategory(Intent.CATEGORY_LAUNCHER);

PendingIntent pendingIntent = 
PendingIntent.getActivity(context, 0, baseIntent,

PendingIntent.FLAG_UPDATE_CURRENT);

-- Kostya

On 02/02/2012 02:25 AM, leslie.karpati wrote:

Hi!

I'am writing an online radio streamer application. It's working very
well (activity-bind service-notificiation bar, ...etc), but
sometimes when I go back to the UI (ex.: click to the application icon
from the menu, when the service and the activity are already running -

onResume) it's start a new/second/duplicated activity, but the old

one does't killed. For example: when I press key back after that it's
destroy the new activity and going to back to the old one, and I can
kill it too.

I put this code to the onResume:
Log.v(TAG, Activity onResume called. Context:+context);
and onlye when the problem is occured (stared the second activity
above the old one), I got a different contex id.

Where is the problem?

Thanks,
Leslie



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

2012-02-01 Thread BT
Thanks, John.

That's unfortunate.

How about downloading FeatureX.so to the Downloads directory,
calling dlopen(featurex.so), then calling the additional library
functions?

Thx,
BT

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

2012-02-01 Thread awtDroid
Does anyone know a way to partition the screen so that a given area
(fragment?) of the screen is developed in a separate APK?  In other
words, can you have multiple APKs driving different parts of the same
screen at the same time?

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


[android-developers] Android Design - List action button

2012-02-01 Thread Peter Sinnott
Currently I am using long clicks and an alert dialog to allow users to
select actions that can be performed on an item in a list view.
I would like to replace this with an action button as this seems to be
suggested practice going forward.

Does the sdk provide a drawable for this type of button? I don't see
anything that matches the guideline.

http://developer.android.com/design/building-blocks/lists.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: Multiple APKs installed to the same location

2012-02-01 Thread John Coryat
You're pretty much stuck sending a complete APK and dealing with additional 
features using switches inside the app itself.

There may be other ways to handle this but I am unaware of them.

-John Coryat

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

Re: [android-developers] partition UI

2012-02-01 Thread TreKing
On Wed, Feb 1, 2012 at 5:20 PM, awtDroid andyturne...@gmail.com wrote:

 can you have multiple APKs driving different parts of the same screen at
 the same time?


No.

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

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

2012-02-01 Thread Kristopher Micinski
Doing this probably means that your app is designed incorrectly, and
should be only one apk.

kris

On Wed, Feb 1, 2012 at 6:20 PM, awtDroid andyturne...@gmail.com wrote:
 Does anyone know a way to partition the screen so that a given area
 (fragment?) of the screen is developed in a separate APK?  In other
 words, can you have multiple APKs driving different parts of the same
 screen at the same time?

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

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


Re: [android-developers] partition UI

2012-02-01 Thread Mark Murphy
On Wed, Feb 1, 2012 at 6:20 PM, awtDroid andyturne...@gmail.com wrote:
 Does anyone know a way to partition the screen so that a given area
 (fragment?) of the screen is developed in a separate APK?  In other
 words, can you have multiple APKs driving different parts of the same
 screen at the same time?

Not really. You can use RemoteViews to push limited UIs from one APK
to the activity of another APK. That, however, would mostly be for
some sort of plugin framework, along the lines of how app widgets plug
into the home screen.

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

Android 4.0 Programming Books: http://commonsware.com/books

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


Re: [android-developers] Re: Multiple APKs installed to the same location

2012-02-01 Thread Mark Murphy
On Wed, Feb 1, 2012 at 6:16 PM, BT bunglestwan...@gmail.com wrote:
 How about downloading FeatureX.so to the Downloads directory,
 calling dlopen(featurex.so), then calling the additional library
 functions?

That would be a question for the android-ndk Google Group.

AFAIK, though, this is not supported. Not to mention that it is highly
insecure, because then anyone can replace your .so with one laden with
malware, and your app will happily execute it, with the malware
inheriting all your permissions.

You can certainly have independent APKs, with their own independent
NDK libraries, that communicate through normal Android IPC mechanisms:
services (commands or binding), broadcasts, etc.

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

Android 4.0 Programming Books: http://commonsware.com/books

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


[android-developers] Re: partition UI

2012-02-01 Thread awtDroid
This is a large OEM app running on a custom tablet-like display, so
it's not going on the market and has nothing to do with a cellphone.

Our current system uses a single exe and multiple dll's which all
create widgets from a shared widget library.  So currently we can make
a change to only one of the dll's, which could change the widgets
owned by this dll, without rebuilding the exe and other dll's.  With
Android everything is packaged into a single APK.  Within this APK we
could have multiple jar's, however making a UI change to one of the
jars would require the whole APK be rebuilt, if I understand this
correctly.

On Feb 1, 5:53 pm, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Feb 1, 2012 at 6:20 PM, awtDroid andyturne...@gmail.com wrote:
  Does anyone know a way to partition the screen so that a given area
  (fragment?) of the screen is developed in a separate APK?  In other
  words, can you have multiple APKs driving different parts of the same
  screen at the same time?

 Not really. You can use RemoteViews to push limited UIs from one APK
 to the activity of another APK. That, however, would mostly be for
 some sort of plugin framework, along the lines of how app widgets plug
 into the home screen.

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

 Android 4.0 Programming Books:http://commonsware.com/books

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


Re: [android-developers] Re: partition UI

2012-02-01 Thread Kristopher Micinski
On Wed, Feb 1, 2012 at 7:22 PM, awtDroid andyturne...@gmail.com wrote:
 This is a large OEM app running on a custom tablet-like display, so
 it's not going on the market and has nothing to do with a cellphone.


You said that already...  I'm implying that the fact it's going on
your custom device shouldn't be an excuse to not read up on the API
and implement it correctly with respect to the Android semantics.

 Our current system uses a single exe and multiple dll's which all
 create widgets from a shared widget library.  So currently we can make
 a change to only one of the dll's, which could change the widgets
 owned by this dll, without rebuilding the exe and other dll's.  With
 Android everything is packaged into a single APK.  Within this APK we
 could have multiple jar's, however making a UI change to one of the
 jars would require the whole APK be rebuilt, if I understand this
 correctly.


I don't see what dlls and exes have to do with it: this has nothing to
do with windows.  You're writing Java code, right?  Or are you using
the NDK and interfacing to your .so code?

Right, if you have change the libraries within the apk, you have to
rebuild it.  This is simply because it's java, it's statically linked
to the jars in the file.  An apk is just a zip file with some dalvik
bytecode in it, along with some other resources... What are you
needing this for, anyway?  Is it that you want to have multiple
processes communicating to display stuff on the screen?

kris

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

2012-02-01 Thread Mark Phillips
I want to have a background image of a game board in one of my activities,
and I am not sure how to implement it. I have been reading about Drawables
and 9patch, and I am confused about the basics.

1. I can draw the image I want in GIMP, but what size do I make it?
Actually, what sizes, as I assume I have to have one for each of the
different resolutions - hdp, ldp, and mdp? Do I need separate images for
both portrait and landscape orientations?

2. Is 9patch just for buttons, or for background images, too? Is this the
tool I need to help with the screen size issues from question #1?

3. I can't seem to find any good tutorials about how to make a background
image for an activity, and how to make it accommodate all the screen sizes
and resolutions. Yes, I have googled for it and looked in O'Rielley's
Programming Android...;)

Thanks,

Mark

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

2012-02-01 Thread avi
I found out the problem. sConnectionId variable has to be initialized
to -1 instead of 0

On Feb 1, 9:43 am, avi avinanku...@gmail.com wrote:
 I would really appreciate it if someone could help me with the below
 problem

 On Jan 27, 10:01 am, avi avinanku...@gmail.com wrote:







  All,

  I am trying to develop an UI based automation system and I was
  exploringAccessibilityEventoption inMonkey. Following are the steps
  that I did
  (i) Launchedmonkeyserver socket
  (ii) Opened Settings app (tried other on board apps as well)
  (iii) Created a client socket from host machine and connected to
 monkey'sserver
  (iv) Issued listviews command
  (v) I always get the response No accessibility event has occured yet

  Could you please let me know if I am missing something?

  Thanks,
  Avi

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

2012-02-01 Thread BT
Good point about security, but this isn't a general consumer
application.  The additional libraries can only be downloaded from our
internal servers and only over our internal wi-fi, plus they're hashed
 verified with our internal security server prior to execution.

We have to run on iOS too, which I believe is even more restrictive,
so we'll probably need to consider more alternatives.  But the ideal
solution would've been some way for us to incrementally add shared
libraries to our app's install directory.

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

2012-02-01 Thread Kristopher Micinski
On Wed, Feb 1, 2012 at 7:35 PM, BT bunglestwan...@gmail.com wrote:
 Good point about security, but this isn't a general consumer
 application.  The additional libraries can only be downloaded from our
 internal servers and only over our internal wi-fi, plus they're hashed
  verified with our internal security server prior to execution.

 We have to run on iOS too, which I believe is even more restrictive,
 so we'll probably need to consider more alternatives.  But the ideal
 solution would've been some way for us to incrementally add shared
 libraries to our app's install directory.


I'd still be skeptical from a security perspective, executing code you
can't really be sure about is always a little shady (yes, I know you
said you checked it).  What kind of code do you need?  It's not
something you could encode into some bytecode like instruction
language or dsl?

kris

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Finishing ActivityGroup which combine Top and Bottom tabs together in same activity ??

2012-02-01 Thread AndroidGirl8


I made ActivityGroup which combined two activities one activity for
TOP tab and second one for BOTTOM tab and it works fine BUT when I
click in any activity on tab both tabs (top and bottom) still there
however this activity don't have them.

My question now how I finish this ActivityGroup how I get rid of it
when I click on any activity in this tabs i tried using finish() but i
throws exception . may be this a stupid question but i still beginner
in android and really appreciate any help

Here is my code :

 public class Multi extends ActivityGroup{
LinearLayout layout;
LinearLayout layout_s1;
LinearLayout layout_s2;


@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);

setContentView(R.layout.multiview);

layout = (LinearLayout) findViewById(R.id.multiview_layout);
layout_s1 = (LinearLayout) findViewById(R.id.my_view_1);
layout_s2 = (LinearLayout) findViewById(R.id.my_view_2);

LocalActivityManager mgr = getLocalActivityManager();

layout_s1.addView((mgr.startActivity(MyOtherActivityInstance1,
new Intent(this, Tab1.class))).getDecorView());
layout_s2.addView((mgr.startActivity(MyOtherActivityInstance2,
new Intent(this, Tab2.class))).getDecorView());


}
   }

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

2012-02-01 Thread Mark Murphy
On Wed, Feb 1, 2012 at 7:22 PM, awtDroid andyturne...@gmail.com wrote:
 This is a large OEM app running on a custom tablet-like display, so
 it's not going on the market and has nothing to do with a cellphone.

That does not change the way Android works.

 Our current system uses a single exe and multiple dll's which all
 create widgets from a shared widget library.  So currently we can make
 a change to only one of the dll's, which could change the widgets
 owned by this dll, without rebuilding the exe and other dll's.  With
 Android everything is packaged into a single APK.  Within this APK we
 could have multiple jar's, however making a UI change to one of the
 jars would require the whole APK be rebuilt, if I understand this
 correctly.

Correct. This should take a handful of seconds, can be automated by
any number of means, etc. The time spent actually creating the APK
should be negligible compared to the time it takes your test suite to
run on the modified result, just as time required to copy one DLL over
another should be negligible compared to the time it takes your test
suite to run on the modified result.

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

Android Training in NYC: http://marakana.com/training/android/

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

2012-02-01 Thread leslie.karpati
Hi,

You are right, the Eclipse launch is really makeing some mess:
I have two condition:
1. Launch with eclipse:  It does't start a new activity if I make
visible the application again with the notification, but start a
'second' activity if I try it with the launcher icon.

2. Normal launch: opposite of the previous one :).

I tried your PendingIntent solution, but it does't solved the
problem.
Right now my NotificationHelper looks like this:

public class NotifierHelper {

private Context context;
private NotificationManager notificationManager;

public NotifierHelper (Context context){
Log.v(TAG, NotifierHelper create);
this.context = context;
notificationManager =
(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
}

public void showNotification(){
Log.v(MediaService.TAG, showNofitication called);

Notification notification = new Notification();
notification.icon = R.drawable.notification_icon;
notification.flags = Notification.FLAG_ONGOING_EVENT |
Notification.FLAG_NO_CLEAR;

Intent baseIntent = new Intent(context, 
ViewPagerActivity.class);
baseIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   
baseIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
   baseIntent.setAction(Intent.ACTION_MAIN);
   baseIntent.addCategory(Intent.CATEGORY_LAUNCHER);

PendingIntent pendingIntent = 
PendingIntent.getActivity(context, 0,
baseIntent, PendingIntent.FLAG_UPDATE_CURRENT);

notification.setLatestEventInfo(context, Radio On, You are 
now
listening a radio..., pendingIntent);
notificationManager.notify(1, notification);
}
}

And I am initializing in the activity on this way:

public static NotifierHelper notifierHelper;
.
@Override
public void onCreate( Bundle savedInstanceState ){
super.onCreate(savedInstanceState);
notifierHelper = new NotifierHelper(thist);
 ...


I guess the problem is somewhere on the this/context line, or i don't
konow

Thanks for your help ,
Leslie


On febr. 1, 23:37, Kostya Vasilyev kmans...@gmail.com wrote:
 Is the app originally launched from Eclipse?

 If so, beware that Eclipse uses a different intent than would normally
 be used by the Launcher(s), so you may get duplicates like this.

 To get a good test, either don't launch from Eclipse, or first press
 Back to close the initial activity, start a new one from Launcher, then
 test your notifications.

 Other than that, here is what I use for widgets / notifications.

 It matches the intent used by Launcher(s), and so resumes an existing
 activity if there is one:

          Intent baseIntent = new Intent(context,  ACTIVITY CLASS
 HERE .class);
          baseIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          baseIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
          baseIntent.setAction(Intent.ACTION_MAIN);
          baseIntent.addCategory(Intent.CATEGORY_LAUNCHER);

          PendingIntent pendingIntent =
 PendingIntent.getActivity(context, 0, baseIntent,
                  PendingIntent.FLAG_UPDATE_CURRENT);

 -- Kostya

 On 02/02/2012 02:25 AM, leslie.karpati wrote:







  Hi!

  I'am writing an online radio streamer application. It's working very
  well (activity-bind service-notificiation bar, ...etc), but
  sometimes when I go back to the UI (ex.: click to the application icon
  from the menu, when the service and the activity are already running -
  onResume) it's start a new/second/duplicated activity, but the old
  one does't killed. For example: when I press key back after that it's
  destroy the new activity and going to back to the old one, and I can
  kill it too.

  I put this code to the onResume:
  Log.v(TAG, Activity onResume called. Context:+context);
  and onlye when the problem is occured (stared the second activity
  above the old one), I got a different contex id.

  Where is the problem?

  Thanks,
  Leslie

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

2012-02-01 Thread David Ross
Actually the Widget uses a RemoteView and you service that view in an
AppWidgetProvider which must register one or more BroadcastReceivers
to handle calls from the AppWidgetManager for updated views or your
own events (through Intents).

The Activity is only used for the optional configuration code that is
run when the user installs the widget in the home screen but after
that Activity finishes the system's AppWidgetManager activates your
BroadcastReceivers.

You can do things like register a click listener for the RemoteView
that will invoke either the same config Activity or another Activity
that provides perhaps extended functionality for the App.

If you want to do something like update the Widget at regular
intervals you must implement your own timer using the AlarmManager
with a PendingIntent and a BroadcastReceiver to handle the event when
the alarm is triggered.

Best to keep your own record of the RemoteView to be updated for each
appWidgetId so that your private internal BroadcastReceivers can
update it. You can use the AppWidgetManager.updateAppWidget() at any
time not just when you get the ACTION_UPDATE intent.

Read the documentation:

 http://developer.android.com/guide/topics/appwidgets/index.html



On Feb 2, 12:03 am, TreKing treking...@gmail.com wrote:
 On Wed, Feb 1, 2012 at 4:08 AM, surabhi jain surabhi17.j...@gmail.comwrote:

  I want to run UI thread with widget without using activity class.

 OK. And ... ?http://www.catb.org/~esr/faqs/smart-questions.html

 Plz help me.

 Plz spell please correctly.

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

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

2012-02-01 Thread David Ross
I would suggest using AlarmManager for your repeating 15s update.
Handle the Intent in a private BroadcastReceiver inside your
AppWidgetProvider. Forget the Service as the scheduling mechanism but
use it for the download of the next image from within your
BroadcastReceiver. In BroadcastReceiver also (re)set the next alarm in
AlarmManager to give the forever 15s repeat. Services can be killed
basically at any time unless they are bound to a Notification but who
wants a Notification if the Widget is on the screen already? Check
your log, you might find the system is killing the Service.

Then, handle Screen On/Off Intents so you only do your downloads when
the screen is on.


On Feb 1, 5:27 am, String sterling.ud...@googlemail.com wrote:
 The failed binder transaction issue basically happens whenever you send
 data too fast to an AppWidget, where too fast is loosely defined. You
 can definitely cause it by sending 1MB at once, but you can also get it by
 sending much smaller quantities at too fast a rate. Which is what it sounds
 like you're doing.

 Your best solution is probably to create a content provider and have your
 widget access that directly for the images, which will avoid the
 RemoteViews (and thus the binder which is causing the problem). A Google
 search for *image content provider* should get you started.

 Having said all that, updating an AppWidget with an image every 15 seconds
 sounds like a recipe for battery drain. You might want to test that
 hypothesis, see how bad the power drain is before you go to the trouble of
 re-implementing the image delivery mechanism. You may need to rethink your
 concept at a deeper level instead.

 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


[android-developers] Ice Cream Sandwich and high memory usage on launch

2012-02-01 Thread dmon
I was doing some memory profiling recently for another issue, and I found 
that, on my phone running ICS, 
as soon as I launch the app the memory is already at about 7 MB, when it 
was usually about 4 MB in others.
I looked at the HPROF file and it seems like the app is keeping a bunch 
(all?) of my app's drawables in memory. 

Is there some pre-fetching going on? Why was this changed? Is there any way 
to disable this? How does
this affect calls to recycle() (see this stackoverflow 
questionhttp://stackoverflow.com/questions/9106674/recycle-bitmap-ice-cream-sandwich-force-close)?
 
Is there some official documentation for the 
change?

Or maybe there's something else going on...

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] EditText selectAll() does not work in ICS

2012-02-01 Thread Stéphane Bruno
Hi,

I am trying to programmatically select all the text in an EditText field 
when a user touches the field so that when the user starts typing it 
replaces the existing text (I cannot use settings in the XML file because 
this field is programmatically added to the screen). To do this, I attached 
an OnFocusChangeListener to the EditText field.  The onFocusChange method 
is below:

@Override

public void onFocusChange(View v, boolean hasFocus) {

EditText editText = (EditText) v;
if (hasFocus) editText.selectAll();

}

This works fine on Android 2.x, but it does not work in ICS. After touching 
the EditText field, the cursor just sits in the begin of the field and the 
text is not selected. Is it a bug? Is there a workaround?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 create a sms database table to store inbox messages in Android

2012-02-01 Thread Ratheesh Valamchuzhy
you need to store the the message in sqlite db ?
use the content resolver to get the message details and we can store it on
a text file or a separate database

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

2012-02-01 Thread unicus unicus
Use bundle object.
save username and password in bundle object and then pass to intent .

*More info*,
http://androidbasic-answer.blogspot.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 : SMS application

2012-02-01 Thread vivek elangovan
Hi members,
  I m developing one application to send SMS,here
i used sendSMS() function and SmsManager class and it is working fine
for sending messages between two emulators.I need to send msgs to real
phones for that i have to mention some SMS gateway.So in SmsManager
class where i can specify the gateway address and their corresponding
username and password.

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

2012-02-01 Thread Fernando Miguélez
Keys are used in raw communication through APDUs

On Wed, Feb 1, 2012 at 7:46 PM, malls masubha...@gmail.com wrote:

 I don't see any interface of passing the keys to open secure element in
 the android code. I am not sure how many people claims that you need google
 Keys to open SecureElement. May be I am missing 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


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

2012-02-01 Thread arun kumar
thanks for the reply...its solved

On Thu, Feb 2, 2012 at 11:22 AM, unicus unicus unicus...@gmail.com wrote:

 Use bundle object.
 save username and password in bundle object and then pass to intent .

 *More info*,
 http://androidbasic-answer.blogspot.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


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

2012-02-01 Thread Monzurul Islam Shamim
   - *xlarge* screens are at least 960dp x 720dp
   - *large* screens are at least 640dp x 480dp
   - *normal* screens are at least 470dp x 320dp
   - *small* screens are at least 426dp x 320dp


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

I think this will help you..

On Thu, Feb 2, 2012 at 6:29 AM, Mark Phillips m...@phillipsmarketing.bizwrote:

 I want to have a background image of a game board in one of my activities,
 and I am not sure how to implement it. I have been reading about Drawables
 and 9patch, and I am confused about the basics.

 1. I can draw the image I want in GIMP, but what size do I make it?
 Actually, what sizes, as I assume I have to have one for each of the
 different resolutions - hdp, ldp, and mdp? Do I need separate images for
 both portrait and landscape orientations?

 2. Is 9patch just for buttons, or for background images, too? Is this the
 tool I need to help with the screen size issues from question #1?

 3. I can't seem to find any good tutorials about how to make a background
 image for an activity, and how to make it accommodate all the screen sizes
 and resolutions. Yes, I have googled for it and looked in O'Rielley's
 Programming Android...;)

 Thanks,

 Mark

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

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

[android-developers] android how to visit those files on pc server by wifi

2012-02-01 Thread silvan_liu
android how to visit those files on pc server by wifi?

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


[android-developers] android onBackPressed not called under tab

2012-02-01 Thread vani reddy
Hi friends,

I have Main Activity. That has 5 tabs(TabHost). I have overridden
onBackPressed in activity groups, as well As All 5 activities. This button
show user a dialog box and for confirmation of Exit When app start. It show
1st tab. Then if I press back it work fine for 4 tabs. But if I go for last
tab and then press back, The app closes .But there is not dialogue for the
user.Even nothing is print in log cat. That I have written in
onBackPressed() method From and of 5 activities including MainActivity.

I have also try onKeyDown() for back key but result is same? Please
reply,its too critical


-- 
Regards,
Vani Reddy

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

2012-02-01 Thread vani reddy
Hi friends,,
Under tabs when onBackPressed i am showing a dialog box, but its throwing
the below exception

ERROR/WindowManager(979): Activity com.amplyfyme.android.HomeScreen has
leaked window
com.android.internal.policy.impl.PhoneWindow$DecorView@40678fb0 that was
originally added here


Toast.makeText(getParent(), inside back prss,
Toast.LENGTH_SHORT).show();
AlertDialog.Builder builder = new
AlertDialog.Builder(getParent());
builder.setMessage(Are you sure you want to exit?)
.setCancelable(false)
.setPositiveButton(Yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
UserProfileActivity.this.finish();
}
})
.setNegativeButton(No,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.cancel();
}
});
alert= builder.create();
alert.show(); //line where exception is thrown

-- 
Regards,
Vani Reddy

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

[android-developers] Re: android help

2012-02-01 Thread ajay talreja
have tried as you told to change Try getting the location through a
location update.  (Use
requestLocationUpdate() or requestSingleUpdate() instead.)

but it is also not working for meproviding the code for your
review..

Code:
gps12.java 
package d.gps12;


import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.widget.TextView;

public class gps12 extends Activity {
/** Called when the activity is first created. */
TextView t1,t2;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LocationManager lm = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
LocationListener ll = new mylocationlistener();
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
ll);
t1=(TextView) findViewById(R.id.TextView01);
t2=(TextView) findViewById(R.id.TextView02);

t1.setText(hii);
t2.setText(h);
}

private class mylocationlistener implements LocationListener {
public void onLocationChanged(Location location) {
if (location != null) {
t1.setText((int) location.getLatitude());
t2.setText((int) location.getLongitude());

}

else
{
t1.setText(unable);
t2.setText(unable);



}
}

public void onProviderDisabled(String provider) {
}
public void onProviderEnabled(String provider) {
}
public void onStatusChanged(String provider, int status,
Bundle extras) {
}

}
}

After launching this application, I'm passing latitude and long.
values from emulator and have also tried passing from command line
through telnet ..but location values seems to be empty so...the
latitude and long. values are not getting displayed.
and the text view are not changing the values.it means that
location changed  method is not getting execute neither its if
part nor its else part..so what might be the problem


isn't the code correct or what might be the other
problems..???
please get it run on your system help 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] Re: Uploading paid android app on Android market

2012-02-01 Thread Zsolt Vasvari
Some uses the forwarding, some doesn't.  A very recent order of mine
(last couple hours) does.

On Feb 1, 9:54 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 On 02/01/2012 05:40 PM, TreKing wrote:



  Google Checkout has an email address you can use that forwards to the
  user.

 No forwarding anymore - my order list has had direct user emails for a
 while now.

 This is a good thing, because the forwarding service used to to mess up
 international characters in replies (I'd see it with Russian).





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

 - Show quoted text -

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


Re: [android-developers] Re: android help

2012-02-01 Thread Kristopher Micinski
I'll look at this tomorrow unless somebody else does first...

By the way, this would be a really good time for you to go read up on
how to use the Eclipse debugger.  This would allow you to put a
breakpoint on your onLocatoonChanged and see if it ever executes.

Additionally, if you don't get any errors, watch the log cat for
errors / warnings as your app executes..

kris

On Thu, Feb 2, 2012 at 2:43 AM, ajay talreja ajayt...@gmail.com wrote:
 have tried as you told to change Try getting the location through a
 location update.  (Use
 requestLocationUpdate() or requestSingleUpdate() instead.)

 but it is also not working for meproviding the code for your
 review..

 Code:
 gps12.java 
 package d.gps12;


 import android.app.Activity;
 import android.content.Context;
 import android.location.Location;
 import android.location.LocationListener;
 import android.location.LocationManager;
 import android.os.Bundle;
 import android.widget.TextView;

 public class gps12 extends Activity {
    /** Called when the activity is first created. */
        TextView t1,t2;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        LocationManager lm = (LocationManager)
 getSystemService(Context.LOCATION_SERVICE);
        LocationListener ll = new mylocationlistener();
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
 ll);
        t1=(TextView) findViewById(R.id.TextView01);
        t2=(TextView) findViewById(R.id.TextView02);

        t1.setText(hii);
        t2.setText(h);
        }

        private class mylocationlistener implements LocationListener {
                public void onLocationChanged(Location location) {
                    if (location != null) {
                    t1.setText((int) location.getLatitude());
                    t2.setText((int) location.getLongitude());

                    }

                    else
                {
                        t1.setText(unable);
                    t2.setText(unable);



                }
                    }

                public void onProviderDisabled(String provider) {
        }
        public void onProviderEnabled(String provider) {
        }
        public void onStatusChanged(String provider, int status,
 Bundle extras) {
        }

 }
        }

 After launching this application, I'm passing latitude and long.
 values from emulator and have also tried passing from command line
 through telnet ..but location values seems to be empty so...the
 latitude and long. values are not getting displayed.
 and the text view are not changing the values.it means that
 location changed  method is not getting execute neither its if
 part nor its else part..so what might be the problem


 isn't the code correct or what might be the other
 problems..???
 please get it run on your system help 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

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