Re: [android-developers] Re: how to distribute a Library Project WITHOUT source code (as jar file) as some sort of SDK?

2012-01-27 Thread Klier Rainer


Am 26.01.2012 23:33, schrieb Mark Murphy:
 On Thu, Jan 26, 2012 at 5:25 PM, joebowbeerjoe.bowb...@gmail.com  wrote:
 Mark Murphy writes:

 You have to rewrite your [library] code to avoid using R. values, as they 
 will be wrong.

 The resource compiler was changed in r14 so that the identifiers in a
 library project's R.java are no longer declared final. This prevents
 the constants from being inlined into library bytecode, and instead
 forces these references to be resolved at runtime. In theory this
 should allow your library to continue to use R. values. Though, as
 explained in the r14 change docs, you won't be able to use resource
 ids in switch statements.

 True, though I'm a bit hesitant to rely upon that behavior until they
 release the full library-project-as-distributable-JAR support.

it workes!

i did it this way:
1. first thing is to have the full library-project.
2. then i copied the whole library-project.
3. in the copy, i removed the source code.
4. in the app-project i added the source-less-library-project as android 
library (to get the R class with all the ids, which really aren't 
final, and the other resources)
5. in the app-project i added the .jar file with all the binary classes 
from the full library-project, which was generated automatically (or by 
running Project/Clean...) by eclipse as external jar-file.
6. the app coming out of the app-project was fully working!

so it seems, that you have to split up source code an resources from a 
library-project and add them separated (and on different places) from 
each other to the app-project.

-- 
Rainer Klier
Research  Development
xyzmo SIGNificant Group  | Austria | USA  | Germany
A-4052 Ansfelden, Haiderstraße 23
Tel.: +43 7229 88060-0, E-Mail: rainer.kl...@xyzmo.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] how to achieve call-out in android

2012-01-27 Thread unicus unicus
you mean calling..


*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] Read XML file in android application

2012-01-27 Thread unicus unicus
put the xml file in asset folder and parse it to get result.

*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] Hai all

2012-01-27 Thread chowdary nani
Hi All,
I need help on taking the screen shoot using android code.
i need to take screen hoot for particular portion of the screen only
can any one help me in passing the parameters for the screen shoot
here is my following code.


  View v1 = L1.getRootView();
  v1.setDrawingCacheEnabled(true);
  Bitmap bm = v1.getDrawingCache();
  BitmapDrawable bitmapDrawable = new
BitmapDrawable(bm);
  image = (ImageView)
findViewById(R.id.ImageView01);
  image.setBackgroundDrawable(bitmapDrawable);

Thanks
Naveen.

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

[android-developers] Interface Designing

2012-01-27 Thread Brad Stintson
Hey all,

How do I design better interface for my android application? Are there any
software or tutorials available which would help in refining the interfaces?

Regards,
Brad Stintson

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

2012-01-27 Thread skink


chowdary nani wrote:
 Hi All,
 I need help on taking the screen shoot using android code.
 i need to take screen hoot for particular portion of the screen only
 can any one help me in passing the parameters for the screen shoot
 here is my following code.


   View v1 = L1.getRootView();
   v1.setDrawingCacheEnabled(true);
   Bitmap bm = v1.getDrawingCache();
   BitmapDrawable bitmapDrawable = new
 BitmapDrawable(bm);
   image = (ImageView)
 findViewById(R.id.ImageView01);
   image.setBackgroundDrawable(bitmapDrawable);

 Thanks
 Naveen.

http://developer.android.com/reference/android/graphics/Bitmap.html#createBitmap(android.graphics.Bitmap,
int, int, int, int)

pskink

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


Re: [android-developers] Interface Designing

2012-01-27 Thread iñaki
Hi Brad: this is awesome:
http://developer.android.com/design/index.html


Iñaki

On 27 January 2012 11:10, Brad Stintson geek.bin...@gmail.com wrote:

 Hey all,

 How do I design better interface for my android application? Are there any
 software or tutorials available which would help in refining the interfaces?

 Regards,
 Brad Stintson

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

2012-01-27 Thread Muhammad UMER

hi pskink, Thanks for your help,It gives more concept.  Please can 
you show me the example that how can i implement these moov atom and ftyp while 
writing the file to the server side.
Regards,umer 

 Date: Thu, 26 Jan 2012 11:26:35 -0800
 Subject: Re: [android-developers] Re: Encoder???
 From: psk...@gmail.com
 To: android-developers@googlegroups.com
 
 step #1:
 see normal .3gp (written by your MediaRecorder) file header, for
 instance:
 # hexdump -C normal_file.3gp | less
   001c66747970 336770340300  |ftyp3gp4|
 0010  336770346d703431 336770360007a42f  |3gp4mp413gp6.../|
 0020  6d6461743c911716 be6679e1e001e7af  |mdatfy.|
 
 step #2: compare it to the file written by your server:
 # hexdump -C server_file.3gp | less
      ||
 0010   0008  ||
 0020  6d6461743c911716 be6679e1e001e7af  |mdatfy.|
 
 as you can see you have to modify first 32 bytes: where bytes [0..27]
 you can just copy and bytes [28.. 31] should contain the offset where
 moov atom starts - you can learn how to find that offset by playing
 with python script called qtfaststart.py - run it with option --list,
 for example:
 # python qtfaststart.py --list normal_file.3gp
 ftyp 0
 mdat 1c
 moov 7a44b
 
 it will show atoms and their sizes but it is trivial to change it to
 show atom's positions (like above):
 
 for atom, pos, size in index:
 print %s %x % (atom, pos)
 
 
 pskink
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
  

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

[android-developers] BroadcastReceiver check Phone state

2012-01-27 Thread Wuffy

Hey Guys,

I am able to read the following Phone states via
intent.getExtras().getString(TelephonyManager.EXTRA_STATE) :

- IDLE
- RINGING
- OFFHOOK

Now i wanted to know if i could somehow check programmatically the
Phone state indicating that a call on hold and an active call have
been merged. I found the following code in the Android build source:

[code]
 /**
 * Returns true if the specified Call is a conference call,
meaning
 * that it owns more than one Connection object.  This information
is
 * used to trigger certain UI changes that appear when a
conference
 * call is active (like displaying the label Conference call,
and
 * enabling the Manage conference UI.)
 *
 * Watch out: This method simply checks the number of Connections,
 * *not* their states.  So if a Call has (for example) one ACTIVE
 * connection and one DISCONNECTED connection, this method will
return
 * true (which is unintuitive, since the Call isn't *really* a
 * conference call any more.)
 *
 * @return true if the specified call has more than one connection
(in any state.)
 */
static boolean isConferenceCall(Call call) {
// CDMA phones don't have the same concept of conference
call as
// GSM phones do; there's no special conference call state
of
// the UI or a manage conference function.  (Instead, when
// you're in a 3-way call, all we can do is display the
generic
// state of the UI.)  So as far as the in-call UI is
concerned,
// Conference corresponds to generic display.
PhoneApp app = PhoneApp.getInstance();
int phoneType = app.phone.getPhoneType();
if (phoneType == Phone.PHONE_TYPE_CDMA) {
CdmaPhoneCallState.PhoneCallState state =
app.cdmaPhoneCallState.getCurrentCallState();
if ((state == CdmaPhoneCallState.PhoneCallState.CONF_CALL)
|| ((state ==
CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE)
 !
app.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing())) {
return true;
}
} else if (phoneType == Phone.PHONE_TYPE_GSM) {
ListConnection connections = call.getConnections();
if (connections != null  connections.size()  1) {
return true;
}
} else {
throw new IllegalStateException(Unexpected phone type: 
+ phoneType);
}
return false;

// TODO: We may still want to change the semantics of this
method
// to say that a given call is only really a conference call
if
// the number of ACTIVE connections, not the total number of
// connections, is greater than one.  (See warning comment in
the
// javadoc above.)
// Here's an implementation of that:
//if (connections == null) {
//return false;
//}
//int numActiveConnections = 0;
//for (Connection conn : connections) {
//if (DBG) log(  - CONN:  + conn + , state = 
+ conn.getState());
//if (conn.getState() == Call.State.ACTIVE)
numActiveConnections++;
//if (numActiveConnections  1) {
//return true;
//}
//}
//return false;
}
[/code]

Has anyone an idea how to access this useful information??

Or maybe another possibility is to let the broadcastreceiver check the
interaction of the user on the native call screen, when he presses the
mergecall()-Button while having on active call and on call on hold?
Does anyone have an idea?

I actually von my broadcastreceiver grab the change of
OneActiveCallAndOneCallOnHold - 3-way-conference 

Greetz Wuffy

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


[android-developers] NDK set up

2012-01-27 Thread Narendra Bagade
Hi All,

1.How to set up development environment for NDK?
2.Once set up done ,how to run sample app of NDK?

I have searched a lot about NDK but didn't get proper guidance.

Please help to get into above two point



-- 
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] Re: Encoder???

2012-01-27 Thread skink


Muhammad UMER wrote:
 hi pskink, Thanks for your help,It gives more concept.  Please 
 can you show me the example that how can i implement these moov atom and ftyp 
 while writing the file to the server side.

http://docs.oracle.com/javase/1.4.2/docs/api/java/io/RandomAccessFile.html

pskink

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


[android-developers] Re: AlarmManager does not fire?

2012-01-27 Thread Rudolf Polzer
Yes, the receiver is an inner class of the activity.

I changed the receiver line in the manifest file to
receiver android:name=.PlanActivity$OnAlarmReceiver/receiver

Then the alarm fires, but with an exception the debugger can't
display.
LogCat says:
newInstance failed: no init()

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

2012-01-27 Thread Rudolf Polzer
This is the stack when the receiver crashes:

ActivityThread.handleReceiver(ActivityThread$ReceiverData) line: 2616
ActivityThread.access$3100(ActivityThread, ActivityThread
$ReceiverData) line: 119
ActivityThread$H.handleMessage(Message) line: 1913
ActivityThread$H(Handler).dispatchMessage(Message) line: 99

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

2012-01-27 Thread Mark Murphy
It would need to be a static public inner class.

On Fri, Jan 27, 2012 at 6:54 AM, Rudolf Polzer rudolf.pol...@i-r-p.de wrote:
 Yes, the receiver is an inner class of the activity.

 I changed the receiver line in the manifest file to
    receiver android:name=.PlanActivity$OnAlarmReceiver/receiver

 Then the alarm fires, but with an exception the debugger can't
 display.
 LogCat says:
 newInstance failed: no init()

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



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

_Android 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


[android-developers] sqlite performance

2012-01-27 Thread Live Happy
 i have android application that it save transaction history in database
file (sqlite) on the sdcard   but there is a lot of records and after
number of records done or size  application create another similar database
file to save in.

 so can anyone tell me after how many record numbers or what size
 the database lose their  performance

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

2012-01-27 Thread TomL
Not all Android devices have the proximity sensor.  In the ones that do, 
most only give a yes/no response to whether something is near the sensor, 
so not really suitable for accurately measuring distance.

What exactly are you trying to do?  

Tom

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

[android-developers] Re: NDK set up

2012-01-27 Thread Oli Wright
If you had searched even a little bit you would have found this page:  
http://developer.android.com/sdk/ndk/index.html

As it says, the group to ask questions is android-ndk, not this one.

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

[android-developers] How to open the ms word documents in android mobile through programming

2012-01-27 Thread Seshu
Hi All,
   I want to open the ms-word/ms-excel sheet documents in my
application. and i implemented reading of pdf files and text files but
i am unable to open the ms-word/ms-excel sheet documents. Can anyone
tell how to implemented?? Thanks in advance?? and my mail id is
s.seshu...@gmail.com

Thanks and Regards,
S.Seshu,
Android Developer,

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

2012-01-27 Thread TreKing
On Fri, Jan 27, 2012 at 12:09 AM, newtoandroid shobana...@gmail.com wrote:

 ünfortunately,the activity has stopped with an ok button.


If you're referring to a force close message, read the stack trace given
in the LogCat and find the Caused by... line.

-
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: My First android programming

2012-01-27 Thread Seshu

Hi Sahar,
 U can install the android apk files in 2 ways,

1) Connect the device to System.
Now Open the command  prompt then do these steps:
a) Locate the android SDK folder i.e., where did u copied the android-
sdk-windows.
For example:
D:\ cd android-sdk-windows.. enter
D:\ cd android-sdk-windows\ cd platform-tools  --- enter
Now
D:\ cd android-sdk-windows\ cd platform-tools adb install -r
sample.apkenter,
here sample.apk should give the complete path where is located
exactly.
Here we need to close all the emulators.

2) Connect the device to System and install the corresponding software
i.e., given by the handset manufacturer,
then go the application right click on it
Select Run as, in that choose Run Configurations. u ll get window. and
u ll find 3 options i.e., Android, Target, Common,
Select Target, In Target select manual and then select Run Button.
After that u ll get another Window i..e, Android Device Chooser there
u ll find list of devices connected.. choose ur mobile here i..e,
displays with the name of device ID.



On Jan 26, 6:44 pm, Sahar Harati saharati2...@gmail.com wrote:
 Hi!

 I'm new in android programming.
 I've developed a program that works perfectly on android emulator but
 I don't know how can I install it on my android device.

 thank you in advanced :)

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

2012-01-27 Thread arun kumar
 you create repeated the button id two times that's the problem.
btnLogin=(Button)this.findViewById(R.id.btnLogin);
   btnLogin=(Button)this.findViewById(R.id.btnLogin);

On Fri, Jan 27, 2012 at 11:39 AM, newtoandroid shobana...@gmail.com wrote:

 i tried a simple login page which gets the gps location if the login
 condition is satisfied,while running it shows ünfortunately,the
 activity has stopped with an ok button. i have created the avd with
 gps support supporting android 4 with google Inc and even set the gps
 manually in ddms perspective.here is my launcher activity.
 package com.first;

 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.Toast;

 public class FirstActivity extends Activity {
EditText txtUserName;
EditText txtPassword;
Button btnLogin;
Button btnCancel;

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

 txtUserName=(EditText)this.findViewById(R.id.txtUname);
txtPassword=(EditText)this.findViewById(R.id.txtPwd);
btnLogin=(Button)this.findViewById(R.id.btnLogin);
btnLogin=(Button)this.findViewById(R.id.btnLogin);
btnLogin.setOnClickListener(new OnClickListener() {

public void onClick(View v) {
// TODO Auto-generated method stub



 if((txtUserName.getText().toString()).equals(txtPassword.getText().toString()))
 {

Toast.makeText(FirstActivity.this, Login
 Successful,Toast.LENGTH_LONG).show();

Intent i=new Intent(context,com.first.LbsGeocoding.class);
startActivityForResult(i,0);
FirstActivity.this.finish();} else{
   Toast.makeText(FirstActivity.this, Invalid
 Login,Toast.LENGTH_LONG).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




-- 
WITH REGARDS
ARUN KUMAR P D
+91-9663471079

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

Re: [android-developers] How can I install a CA root certificate on Android 2.3.4?

2012-01-27 Thread Nikolay Elenkov
On Wed, Jan 25, 2012 at 4:56 AM, Rene rtrev...@gmail.com wrote:
 Hi.

 Where I work use an internal CA root. One service attached to this CA
 is the exchange, then I need to sync my android device with email,
 calendar, contacts, etc.

 How can I install a CA root certificate on Android 2.3.4?


Unless  you have a rooted device, you can't.

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

2012-01-27 Thread gcstang
I know there are solutions such as :
Amazon S3
Google Storage
Sending data to my own server
etc...

What I'm wondering is what is the implementations that have been tried
and are working for others?


On Jan 25, 7:09 am, gcstang gcst...@gmail.com wrote:
 What is thebestsolution to integratebackup, external to the device
 for an Android application?

 Ideally the solution will be cheap, integrate easily with an existing
 application and will be seamless to the clients.

 I know GoogleBackupis limited so most likely it will not work, but
 there has to be other solutions.

 Backupper client will be roughly 5-10MB in size.

 Thank 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: AlarmManager does not fire?

2012-01-27 Thread Anieeh
I think you have not registered Receiver in Activity with receiver
object and intentFilter

registerReceiver(android.content.BroadcastReceiver receiver,
android.content.IntentFilter filter)

Animesh S. Sinha.


On Jan 27, 5:00 pm, Rudolf Polzer rudolf.pol...@i-r-p.de wrote:
 This is the stack when the receiver crashes:

 ActivityThread.handleReceiver(ActivityThread$ReceiverData) line: 2616
 ActivityThread.access$3100(ActivityThread, ActivityThread
 $ReceiverData) line: 119
 ActivityThread$H.handleMessage(Message) line: 1913
 ActivityThread$H(Handler).dispatchMessage(Message) line: 99

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

2012-01-27 Thread Kostya Vasilyev
No, that's because the inner class is not static - which is wrong for a 
manifest-registered receiver.


A non-static inner class object can only be instantiated inside an 
instance of the enclosing class, therefore, when the intent fires, the 
Android framework is unable to instantiate the receiver object on its own.


-- Kostya

27.01.2012 17:43, Anieeh пишет:

I think you have not registered Receiver in Activity with receiver
object and intentFilter

registerReceiver(android.content.BroadcastReceiver receiver,
android.content.IntentFilter filter)

Animesh S. Sinha.


On Jan 27, 5:00 pm, Rudolf Polzerrudolf.pol...@i-r-p.de  wrote:

This is the stack when the receiver crashes:

ActivityThread.handleReceiver(ActivityThread$ReceiverData) line: 2616
ActivityThread.access$3100(ActivityThread, ActivityThread
$ReceiverData) line: 119
ActivityThread$H.handleMessage(Message) line: 1913
ActivityThread$H(Handler).dispatchMessage(Message) line: 99


--
Kostya Vasilyev

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


Re: [android-developers] Dynamically populating LinearLayout in an AppWidget

2012-01-27 Thread Kostya Vasilyev
I don't see anything in the source for RemoteViews that would do that, 
maybe I'm not looking well enough.


My suggestion would be -- for debugging purposes only -- to simulate a 
RemoteViews update cycle within your own application, checking the 
result, and stepping through the code if necessary.


By this I mean: writing your views object into a Parcelable, cloning a 
new instance from that Parcelable, inflating your widget's root layout, 
and applying the cloned RemoteViews.


Oh, and one more thing: your widget updates are all executed from one 
place in the code, updating everything at once -- the views, the pending 
intents if any, the background images -- right?


-- Kostya

27.01.2012 8:37, TreKing ?:

Folks,

I'm getting my feet wet on app widgets so I'm probably missing 
something obvious, but I've hit a snag that's got me stumped.
Basically, I cannot seem to dynamically add more than one instance of 
the same layout to a LinearLayout living in a RemoteViews object. Only 
the /first/ item gets added.

Has anyone seen anything like that?

Here's more detail to clarify: I've got something like this in an 
IntentService that creates a list of objects to display.



// Create remote view for main widget layout
RemoteViews views = new RemoteViews(getPackageName(), 
R.layout.widget_layout);


// list is some list of objects populated in the IntentService
for (int i = 0; i  list.size(); i++)
{
// Create remote view for the object to add to linear layout
RemoteViews v = new RemoteViews(getPackageName(), 
R.layout.linear_layout_entry);


// ... Set Text on text views in v for the current object

// Add new view to the linear layout in the widget
views.addView(R.id.ll_widget, v);
}

AppWidgetManager man = AppWidgetManager.getInstance(this);
man.updateAppWidget(widgetID, views);


Now, this works as expected for the first item in the list. However, 
all others seem to be getting ignored - my widget only shows the first 
entry in the list even though there is plenty of room.
I've stepped through the loop and it's definitely getting populated 
and I can see that the main views RemoteViews object has multiple 
nested views that should be my dynamic views, but they just don't 
appear.


If I manually add instances of the layout (the one I'm inflating) to 
the linear layout via the designer, they show up.
If I dynamically add instances of /different/ layouts to the 
LinearLayout one after the other, they show up.
If I dynamically add instances of /the same layout/ to the 
LinearLayout, then only the first shows up.


So apparently I can only add one instance of a given layout to a 
LinearLayout for a widget? That does not seem right at all ...


I've gone though the docs and samples and searched this list, 
StackOverflow, and b.android.com http://b.android.com and not found 
anything about this.
There are no warnings or errors in the LogCat. I've tried on my 2.3.3 
device and various emulators and no dice.


I can hack this up and manually add a bunch of the layouts and not use 
the ones I don't need, but I really feel like this should work.
Anyone else seen this while working on widgets and have a clue what 
I'm doing wrong?


Thanks.

-
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 


--
Kostya Vasilyev

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

[android-developers] Re: SQLiteDatabase.execSQL() not behaving as expected

2012-01-27 Thread Robert Hawkey
Yes you would be right if I was using MATCH for the SELECT from the
temporary SearchResults table; however, I'm not doing that. I just
select all the rows from that table as it is not an FTS3 table.  Yes
you're also correct, neither iOS nor Android seem to support FTS4
tables at the moment.  My tables are FTS3 tables.

I suspect it must have something to do with the internal
implementation of execSQL().  It must not truly be a 1:1 mapping of
the C sqlite3_exec() function in the SQLite3 library, I suspect
they're doing something else.  I suspect this because the
documentation says not to include multiple statements separated
with ;'s when calling execSQL(), whereas you can do that with
sqlite3_exec().

Rob

On Jan 26, 6:52 pm, John jsp...@gmail.com wrote:
 Oh and from the same session:

 sqlite sqlite CREATE VIRTUAL TABLE pages USING fts4(title, body);
 SQL error: no such module: fts4SQL error: near sqlite: syntax error
 sqlite

 On Jan 26, 3:15 pm, Robert Hawkey rhaw...@gmail.com wrote:







  SQlite supports FTS3 and FTS4 (full text searching).  I've seen
  documentation (don't have it handy) that FTS3 is enabled in the build
  of SQLite shipped in the API level I'm using so MATCH is valid.  I
  know MATCH does work because I do at least get one return value.
  Also, when I perform the work via rawQueries I get the full results.

  Rob

  On Jan 26, 2:23 pm, Mark Murphy mmur...@commonsware.com wrote:

   I have never used MATCH in SQLite. The LIKE operator uses %, not *, as
   the wildcard.

  http://sqlite.org/lang_expr.html

   On Tue, Jan 24, 2012 at 10:45 AM, Robert Hawkey rhaw...@gmail.com wrote:
Hi everyone,

I have an app I wrote for the iOS that makes extremely heavy use of a
large database, I am now porting that app to the Android platform.

I have a great deal of operations that follow this pattern:

1    db.execSQL(CREATE TEMPORARY TABLE SearchResults(Name text););
2    db.execSQL(INSERT INTO SearchResults (Name) SELECT Name FROM
ProductNames WHERE NameLower MATCH ' + term + *';);
3    db.execSQL(INSERT INTO SearchResults (Name) SELECT Name FROM
BrandNames WHERE NameLower MATCH ' + term + *';);
...
Cursor cursor = db.rawQuery(SELECT Name FROM SearchResults +
myCount, null);
cursor.moveToFirst();
if (!cursor.isAfterLast())
{
   Debug.log(DB, - Adding:  + cursor.getString(0));
   resultSet.add(cursor.getString(0));
   cursor.moveToNext();
}
cursor.close();

On iOS using the SQLite3 C API and sqlite3_exec() all of these
statements work perfectly fine.  However, on Android they are
exhibiting strange behaviour.  I seem to only ever gets one row, it
seems from the very first INSERT (the line that starts with 2 above).

My goal here is to wrap all of the above commands in a begin and end
transaction so that I can prevent multiple transactions from being
created, also I use a temporary in memory table rather than a
rawQuery() with just the selects because that prevents the bridge from
the database layer to the Java layer from happening until the very end
which seems to result in much better performance.

When I rewrite the above logic to look like this:

Cursor cursor = db.rawQuery(SELECT Name FROM Table1 WHERE NameLower
MATCH ' + term + *', null);
cursor.moveToFirst();
while (!cursor.isAfterLast())
{
   resultSet.add(cursor.getString(0));
   cursor.moveToNext();
}
cursor.close();
cursor = db.rawQuery(SELECT Name FROM Table2 WHERE NameLower MATCH '
+ term + *', null);
cursor.moveToFirst();
while (!cursor.isAfterLast())
{
   resultSet.add(cursor.getString(0));
   cursor.moveToNext();
}
cursor.close();
...

It works perfectly returning all the proper results, however this is
extremely slow.

Could anyone explain to me why the execSQL() calls above would not
work as I expect them too (and how they work on iOS)?

Thanks!

Rob

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

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

   Android Training in DC: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

Re: [android-developers] Dynamically populating LinearLayout in an AppWidget

2012-01-27 Thread TreKing
On Fri, Jan 27, 2012 at 8:31 AM, Kostya Vasilyev kmans...@gmail.com wrote:

 I don't see anything in the source for RemoteViews that would do that,
 maybe I'm not looking well enough.


Yeah, I briefly stepped through the source and didn't see anything obvious.
But then my eyes glazed over =) I haven't had to spend much time with the
source so I thought I'd ask first before trudging through and trying to
make sense of it all.


 My suggestion would be -- for debugging purposes only -- to simulate a
 RemoteViews update cycle within your own application, checking the result,
 and stepping through the code if necessary.

 By this I mean: writing your views object into a Parcelable, cloning a
 new instance from that Parcelable, inflating your widget's root layout, and
 applying the cloned RemoteViews.


Good idea - I'll give that a shot this weekend. Gah, and this was going so
well :(


 Oh, and one more thing: your widget updates are all executed from one
 place in the code, updating everything at once -- the views, the pending
 intents if any, the background images -- right?


Well, I do update them in 3 places: onUpdate() to set up the widgets from
configured data when necessary; in the configuration Activity when I'm done
setting up the widget to initialize it; and then in this IntentService when
it's called on tapping the widget.

But this is the only place that updates the widget after it's been
configured and added to the home screen. And it works as expected if it's
not the same layout being added to the LinearLayout (whether it's in a loop
or sequentially) so I don't think my layout is being modified anywhere else.

Thanks.

-
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: Multi Language Tool

2012-01-27 Thread Eurig Jones
Due to the fact that Google Translate API is now a closed shop and not
available I don't think it's possible. I've tried all sorts of plugins
that probably used to work before this happened but now they don't.

I found this guy who translated my app for me probably using google
translate, but he got back to me very quickly: 
https://sites.google.com/site/androidstrings

The anrolate plugin was slightly buggy good, shame.

On Jan 15, 6:25 pm, Mark Murphy mmur...@commonsware.com wrote:
 I think MOTODEV Studio for Android supports this.









 On Sun, Jan 15, 2012 at 1:24 PM, Brad Gies rbg...@gmail.com wrote:
  Hi,

  I need to add multi-language capabilities to an Android App I'm developing,
  and I've been thinking about building a tool to parse mystrings.xmlfile,
  and automatically add the translations for the translations I want (using
  theGoogleTranslateAPI). Anyone know if something like this already
  exists?

  Sincerely,

  Brad Gies
  --
  bgies.com              maxhomevalue.com
  idailythought.com      greenfarminvest.com
  --

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


Re: [android-developers] Dynamically populating LinearLayout in an AppWidget

2012-01-27 Thread Mark Murphy
On Thu, Jan 26, 2012 at 11:37 PM, TreKing treking...@gmail.com wrote:
 If I manually add instances of the layout (the one I'm inflating) to the
 linear layout via the designer, they show up.
 If I dynamically add instances of different layouts to the LinearLayout one
 after the other, they show up.
 If I dynamically add instances of the same layout to the LinearLayout, then
 only the first shows up.

 So apparently I can only add one instance of a given layout to a
 LinearLayout for a widget? That does not seem right at all ...

Try calling setId() on LinearLayout before passing it to addView(),
giving it a unique ID value, and see if that helps.

-- 
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] Dynamically populating LinearLayout in an AppWidget

2012-01-27 Thread TreKing
On Fri, Jan 27, 2012 at 9:44 AM, Mark Murphy mmur...@commonsware.comwrote:

 Try calling setId() on LinearLayout before passing it to addView(), giving
 it a unique ID value, and see if that helps.


Actually, I had that idea. I forget the exact message, but it yelled at me
that I can't call that particular method (via the setInt method of the
RemoteViews interface). It then displays a default error layout for the
widget.

-
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: Creating an application to edit photos

2012-01-27 Thread JackN
Might be hard to find a virtual makeup studio api, but you could check
this out for ideas

https://market.android.com/details?id=com.jnn.jw.lookhl=en

On Jan 26, 1:53 pm, TreKing treking...@gmail.com wrote:
 On Tue, Jan 24, 2012 at 11:52 PM, Soorie sapient.sur...@gmail.com wrote:
  I request you all to please provide answers for above queries as I
  am stuck at this start level :(

 If you don't get a response, I would suggest you back up and try something
 a little more reasonable for your experience level. Practice, learn, gain
 experience, then come back to this idea. Good luck.

 ---­--
 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: AlarmManager does not fire?

2012-01-27 Thread Rudolf Polzer
I removed the inner classes:
I put the classes WakefulIntentService, OnAlarmReceiver and AppService
into separate files and now the alarm manager is working.

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] I can't get onLongClick on Button to be passed to enclosing TableRow.

2012-01-27 Thread Jan Skarvall
Hi

This feels kind of embarrassing. Have I misunderstood the basics?

I want a Button to take care of Clicks, but to pass on LongClicks to
an enclosing View, in this case a TableRow.
I just can't get it work. I simplified the code down to what is shown
below without luck.

package my.namespace;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnLongClickListener;
import android.widget.Button;
import android.widget.TableLayout;
import android.widget.TableRow;

public class OnLongClickNotPassedOnToTableRowActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TableLayout t = new TableLayout(this);
TableRow r = new TableRow(this);
r.setLongClickable(true);  // Doesn't help.
t.addView(r);
r.setOnLongClickListener(new OnLongClickListener() {

@Override
public boolean onLongClick(View v) {
return true;// Never reached.
}
});
Button b = new Button(this);
r.addView(b);
/*
b.setOnLongClickListener(new OnLongClickListener() {

@Override
public boolean onLongClick(View v) {
return false;   // Reached on long click if 
uncommented
// but doesn't 
help either.
}
});
*/
setContentView(t);
}
}

Jan

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

2012-01-27 Thread Kostya Vasilyev


27.01.2012 19:20, TreKing пишет:


Well, I do update them in 3 places: onUpdate() to set up the widgets 
from configured data when necessary; in the configuration Activity 
when I'm done setting up the widget to initialize it; and then in this 
IntentService when it's called on tapping the widget.


But this is the only place that updates the widget after it's been 
configured and added to the home screen. And it works as expected if 
it's not the same layout being added to the LinearLayout (whether it's 
in a loop or sequentially) so I don't think my layout is being 
modified anywhere else.




Ok.

Just remember - for a given widget instance, only one, the most recent 
RemoteViews survives.


--
Kostya Vasilyev

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


[android-developers] null returned: 139

2012-01-27 Thread Dennis
Hi

when i build with ant ( ant debug install) i get the following error.

-package-resources:
 [aapt] Creating full resource package...

BUILD FAILED
/home/dennis/android-sdk-linux/tools/ant/build.xml:792: The following
error occurred while executing this line:
/home/dennis/android-sdk-linux/tools/ant/build.xml:808: null returned:
139

i have the latest ant and android adk.

i have updated the project build files..

im using ubuntu with the official jdk ver 1.6.0_26 from the command
line.

regards
Dennis

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

2012-01-27 Thread Brad Stintson
Hi all,

Thanks Inaki. It really is awesome.

But my problem is, I am looking for some help or some software or tutorials
for designing a better UI for Android 2.1+. Something that would make my
task easier. As for an example if anyone does know how they design the
custom layouts for apps like Go sms or viber.

Regards,
Brad Stintson

On Fri, Jan 27, 2012 at 3:42 PM, iñaki inaki.s...@gmail.com wrote:

 Hi Brad: this is awesome:
 http://developer.android.com/design/index.html


 Iñaki

 On 27 January 2012 11:10, Brad Stintson geek.bin...@gmail.com wrote:

 Hey all,

 How do I design better interface for my android application? Are there
 any software or tutorials available which would help in refining the
 interfaces?

 Regards,
 Brad Stintson

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


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

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

[android-developers] AccessibilityEvent in monkey

2012-01-27 Thread avi
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


[android-developers] Re: Possible TabHost bug on samsung galaxy 10.1 tab running 3.2

2012-01-27 Thread Jim Andresakis
After looking at my code over a couple of days and comparing it to
other examples I found that I had been using the following code in my
set up which the galaxy tab didnt seem to like:

 TabHost xmlns:android=http://schemas.android.com/
apk/res/android
android:id=@+id/my_tabhost
android:layout_width=match_parent
android:layout_height=match_parent 
LinearLayout
android:orientation=vertical
android:layout_width=match_parent
android:layout_height=match_parent
android:padding=5dp
TabWidget
android:id=@android:id/tabs
android:layout_width=match_parent
android:layout_height=match_parent/
   FrameLayout
android:id=@android:id/tabcontent
android:layout_width=match_parent
android:layout_height=match_parent
android:padding=5dp

I got rid of the padding and changed that code to the following and
now all is well and I have my custom menu just how I wanted :) thanks
to that dude Mark otherwise known as CommonsWare :)


TabHost xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@+id/my_tabhost
android:layout_width=match_parent
android:layout_height=match_parent 

LinearLayout
android:orientation=vertical
android:layout_width=match_parent
android:layout_height=match_parent
TabWidget
android:id=@android:id/tabs
android:layout_width=match_parent
android:layout_height=wrap_content/
   FrameLayout
android:id=@android:id/tabcontent
android:layout_width=fill_parent
android:layout_height=fill_parent

For some reason I think the padding had cause the view in the tabhost
to show up empty or be registered that it had been set to GONE
regardless that I had set it to VISIBLE in my java class.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 in ListView footer not visible when the soft keyboard is present

2012-01-27 Thread ivan
I have a ListView and I'm placing an EditText view in its footer, but
the soft keyboard blocks the EditText view when it pops up.

My AndroidManifest has:

activity
android:name=com.myapp.views.activities.StoresSearchActivity
android:label=@string/appName
android:screenOrientation=portrait
android:launchMode=singleInstance
android:windowSoftInputMode=adjustResize /

My activity layout:

ListView android:id=@+id/stores_preferredStores
xmlns:android=http://schemas.android.com/apk/res/android;
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
android:dividerHeight=0dp
android:divider=#
android:overScrollFooter=@null
/

My footer is a complex view with a couple different buttons and an
edit text view so it doesn't make sense to not have it scroll with the
list view, being so tall.

My footer layout:

RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
android
  android:id=@+id/footerlayout
  android:layout_width=fill_parent
android:layout_height=wrap_content
  android:layout_marginBottom=10dp

TextView android:layout_height=wrap_content
android:id=@+id/store_search_text
android:text=@string/store_search_find_header_text
android:layout_width=fill_parent
android:layout_marginLeft=10dp
android:layout_marginRight=10dp
android:textColor=@color/white
android:layout_alignParentLeft=true
/TextView
Button
android:id=@+id/store_search_use_location_button
android:layout_width=fill_parent
android:layout_marginTop=10dp
android:layout_height=40dp
android:layout_below=@id/store_search_text
android:text=@string/store_search_location_button_text
android:layout_alignLeft=@id/store_search_text
android:layout_alignRight=@id/store_search_text
style=@style/ActionButton.LtBlue
/Button
TextView android:layout_height=wrap_content
android:id=@+id/store_search_or
android:text=Or
android:textColor=@color/white
android:layout_width=fill_parent
android:layout_marginTop=10dp
android:layout_below=@id/
store_search_use_location_button
android:layout_alignLeft=@+id/
store_search_use_location_button
android:layout_alignRight=@+id/
store_search_use_location_button
/TextView
EditText android:layout_height=wrap_content
android:id=@+id/store_search_query
android:layout_width=fill_parent
android:layout_marginLeft=10dp
android:layout_marginRight=10dp
android:layout_marginTop=10dp
android:paddingLeft=5dp
android:layout_below=@id/store_search_or
android:hint=@string/search_hint
android:inputType=textPostalAddress
android:imeOptions=actionDone 
/EditText
Button
android:id=@+id/store_search_find_location
android:layout_width=fill_parent
android:layout_height=40dp
android:layout_below=@id/store_search_query
android:text=@string/
store_search_find_location_button_text
android:layout_alignLeft=@+id/store_search_query
android:layout_alignRight=@+id/store_search_query
style=@style/ActionButton.LtBlue
/Button
/RelativeLayout

I've set up an OnScrollListener, and it appears the ListView is not
getting resized as it should when the soft keyboard pops up.

Does anyone have any ideas on how I can get the EditText above the
soft keyboard?

Thanks.

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


[android-developers] How to get utf-8 encode page with HTTP request?

2012-01-27 Thread TurboMan
Hi,

I've been bogging down for a while but no like.
I am trying to get a page with HTTP request, but it has non-ascii 
characters such as Ç, Ş, İ, Ö, Ğ.
But, I see other characters  without any problem except those kind of 
characters.
I use the following code, got it through google search.
It does the job except the above problem.

String responseString;
HttpClient httpclient = new DefaultHttpClient(); 
HttpResponse response = httpclient.execute(new 
HttpGet(http://somepage.com;));
StatusLine statusLine = response.getStatusLine();
if(statusLine.getStatusCode() == HttpStatus.SC_OK){ 
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  DataOutputStream dout = new DataOutputStream(out);
  response.getEntity().writeTo(dout);
   out.close();
   responseString = out.toString();
   httpclient.getConnectionManager().shutdown();
}

Any help is appreciated

Regards
TM

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 get utf-8 encode page with HTTP request?

2012-01-27 Thread Mark Murphy
http://stackoverflow.com/questions/4480363/android-java-utf-8-httpclient-problem
http://stackoverflow.com/questions/1900409/how-to-read-non-english-texts-in-java-they-are-represented-in-wrong-encoding


On Fri, Jan 27, 2012 at 4:30 PM, TurboMan yusufce...@gmail.com wrote:
 Hi,

 I've been bogging down for a while but no like.
 I am trying to get a page with HTTP request, but it has non-ascii characters
 such as Ç, Ş, İ, Ö, Ğ.
 But, I see other characters  without any problem except those kind of
 characters.
 I use the following code, got it through google search.
 It does the job except the above problem.

 String responseString;
 HttpClient httpclient = new DefaultHttpClient();
 HttpResponse response = httpclient.execute(new
 HttpGet(http://somepage.com;));
 StatusLine statusLine = response.getStatusLine();
 if(statusLine.getStatusCode() == HttpStatus.SC_OK){
   ByteArrayOutputStream out = new ByteArrayOutputStream();
   DataOutputStream dout = new DataOutputStream(out);
   response.getEntity().writeTo(dout);
    out.close();
    responseString = out.toString();
    httpclient.getConnectionManager().shutdown();
 }

 Any help is appreciated

 Regards
 TM

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



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

Android 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: Scroll View

2012-01-27 Thread Oliviu Vais
I still want to scroll the view to the right or left using two buttons
in my app.
I got this far, but this doesn't work. Please help!!

public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub

if(v.getId() == MotionEvent.ACTION_DOWN){
scroll = 1;
}else if(v.getId() == MotionEvent.ACTION_UP){
scroll = 0;
}

switch (v.getId()) {
case R.id.bRight:

while (scroll == 1) {

sw.scrollBy(5, 0);
}

case R.id.bLeft:

while (scroll == 1) {

sw.scrollBy(-5, 0);
}
}

return false;
}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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-01-27 Thread Michael Roland
Hallo Saurabh,

 What is the significance of this : 
 
I just looked through my code and found that I also explicitly disabled
ISO 14443-4 activation (before polling) using this command:
 FF0003D41224

See page 9 of the reader API manual:

Some Type A Tags may support both ISO14443-3 Type A and ISO14443-4 Type
A operating modes. For example, JCOP30 supports MIFARE 1K emulation
(ISO14443-3) and ISO14443-4. If the reader sends a RATS command to the
tag, the ISO14443-4 mode will be activated, or the tag remains in MIFARE
1K emulation mode (ISO14443-3). It is up to the
application to decide which operating mode to be activated. By default,
the reader will perform automatic ISO14443-4 activation if the tag
supports ISO14443-4.
* To disable automatic ISO14443-4 activation: FF 00 00 00 03 D4 12 24
* To Enable automatic ISO14443-4 activation: FF 00 00 00 03 D4 12 34

So you need to disable ISO 14443-4 activation *before* you start the
anti-collision sequence. Once the RATS command is sent, the SmartMX will
not accept raw MIFARE classic commands anymore.

br
Michael

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


[android-developers] How to test if something is a PopupWindow

2012-01-27 Thread plnelson
(I posted this on Stack Overflow but as of this writing I've received no 
response)

I'm writing code that starts with a View object in a layout hierarchy and 
iteratively walks up the tree to the view root, using *getParent()*, 
displaying information about each level as it goes. 

Everything is working fine except for PopupWindow, which is one of the 
classes I want to display. All the other ones in my layout are derived 
directly or indirectly from the View class, e.g., LinearLayout, 
RelativeLayout, Button etc. So I get the Parent View (vPar) and do a 

Object obj = (Object)vPar;

To test for, say, RelativeLayout I can then do a . . .

if (obj instanceof RelativeLayout ) {

...

But this doesn't work for PopupWindow. Even though PopupWindow is derived 
from Object, when it's in a layout it's shown as 
PopupWindow$PopupViewContainer in the debugger. And PopupViewContainer is 
not part of the public API, according to 
http://www.kiwidoc.com/java/l/x/android/android/5/p/android.widget/c/PopupWindow.PopupViewContainer.

So how do I test to see if I have a PopupWindow as I'm walking up the 
hierarchy?

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

Re: [android-developers] How to test if something is a PopupWindow

2012-01-27 Thread Mark Murphy
Test getClass().getName() to see if it is
android.widget.PopupWindow$PopupViewContainer, presumably.

Of course, there may be a better solution for whatever it is you are
trying to do, but your rationale behind walking the view hierarchy
this way escapes me.

On Fri, Jan 27, 2012 at 5:14 PM, plnelson pna...@gmail.com wrote:
 (I posted this on Stack Overflow but as of this writing I've received no
 response)

 I'm writing code that starts with a View object in a layout hierarchy and
 iteratively walks up the tree to the view root, using getParent(),
 displaying information about each level as it goes.

 Everything is working fine except for PopupWindow, which is one of the
 classes I want to display. All the other ones in my layout are derived
 directly or indirectly from the View class, e.g., LinearLayout,
 RelativeLayout, Button etc. So I get the Parent View (vPar) and do a

 Object obj = (Object)vPar;

 To test for, say, RelativeLayout I can then do a . . .

 if (obj instanceof RelativeLayout ) {

 ...

 But this doesn't work for PopupWindow. Even though PopupWindow is derived
 from Object, when it's in a layout it's shown as
 PopupWindow$PopupViewContainer in the debugger. And PopupViewContainer is
 not part of the public API, according to
 http://www.kiwidoc.com/java/l/x/android/android/5/p/android.widget/c/PopupWindow.PopupViewContainer
 .

 So how do I test to see if I have a PopupWindow as I'm walking up the
 hierarchy?

 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



-- 
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] Dynamically populating LinearLayout in an AppWidget

2012-01-27 Thread YuviDroid
Hey,

I think I had a similar problem some time ago...unfortunately I don't
remember exactly how I solved. However I think I used
RemoteViews.removeAllViews().

I would try:
RemoteViews views = new RemoteViews(getPackageName(),
R.layout.widget_layout);
views.removeAllViews(R.id.ll_widget);

... rest of your code.


Hope it helps!
Yuvi

http://www.droidahead.com

On Fri, Jan 27, 2012 at 5:37 AM, TreKing treking...@gmail.com wrote:

 Folks,

 I'm getting my feet wet on app widgets so I'm probably missing something
 obvious, but I've hit a snag that's got me stumped.
 Basically, I cannot seem to dynamically add more than one instance of the
 same layout to a LinearLayout living in a RemoteViews object. Only the *
 first* item gets added.
 Has anyone seen anything like that?

 Here's more detail to clarify: I've got something like this in an
 IntentService that creates a list of objects to display.


 // Create remote view for main widget layout
 RemoteViews views = new RemoteViews(getPackageName(),
 R.layout.widget_layout);

 // list is some list of objects populated in the IntentService
 for (int i = 0; i  list.size(); i++)
 {
 // Create remote view for the object to add to linear layout
 RemoteViews v = new RemoteViews(getPackageName(),
 R.layout.linear_layout_entry);

 // ... Set Text on text views in v for the current object

 // Add new view to the linear layout in the widget
 views.addView(R.id.ll_widget, v);
 }

 AppWidgetManager man = AppWidgetManager.getInstance(this);
 man.updateAppWidget(widgetID, views);


 Now, this works as expected for the first item in the list. However, all
 others seem to be getting ignored - my widget only shows the first entry in
 the list even though there is plenty of room.
 I've stepped through the loop and it's definitely getting populated and I
 can see that the main views RemoteViews object has multiple nested
 views that should be my dynamic views, but they just don't appear.

 If I manually add instances of the layout (the one I'm inflating) to the
 linear layout via the designer, they show up.
 If I dynamically add instances of *different* layouts to the LinearLayout
 one after the other, they show up.
 If I dynamically add instances of *the same layout* to the LinearLayout,
 then only the first shows up.

 So apparently I can only add one instance of a given layout to a
 LinearLayout for a widget? That does not seem right at all ...

 I've gone though the docs and samples and searched this list,
 StackOverflow, and b.android.com and not found anything about this.
 There are no warnings or errors in the LogCat. I've tried on my 2.3.3
 device and various emulators and no dice.

 I can hack this up and manually add a bunch of the layouts and not use the
 ones I don't need, but I really feel like this should work.
 Anyone else seen this while working on widgets and have a clue what I'm
 doing wrong?

 Thanks.


 -
 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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
to quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

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

[android-developers] Re: Logcat is broken every time phone is unplugged

2012-01-27 Thread Indicator Veritatis
Although I dont' remember encountering exaclty the same problem, the
unreliability of logcat display from inside Eclipse is the reason I
long ago got into the habit of runnig logcat in a Terminal window (I
run Eclipse under Linux, not Windows) instead. But even then, when I
disconnect the USB cable for the phone, I find that often I have to
restart adb. But this is a lot less drastic than restarting Eclipse.

So that is what I suggest you try: stop and restart the server using
the adb command from a terminal window (or a command shell) when you
see that problem. It is a lot faster than restarting Eclipse.

On Jan 14, 12:24 pm, Keith Wiley kbwi...@gmail.com wrote:
 Every time the phone is unplugged from USB, the logcat is permanently
 corrupted in that the when the phone is reconnected, logcat does not
 reestablish.  Restarting an app, either in debug or run mode produces
 zero logcat output after that point.  Closing the logcat window view
 and reopening it has no effect.  The only solution is to quit and
 restart Eclipse.  Therefore, I must quit and restart Eclipse every
 time I take my phone with me and then later return.

 I've been having this problem since day one with Android development,
 three years ago.  In that time I have installed new versions of
 Eclipse and numerous updates to the Android SDK and Eclipse plugin.
 Nothing has ever improved the situation w.r.t. this bug.

 Anyone know anything about this?

 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] No resource identifier found for attribute 'tabLayout' in package 'android'

2012-01-27 Thread Grantland
Is there any reason that the attribute android:tablayout isn't
publicly available? I can find it in the source here:

https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/attrs.xml#L2912

but it doesn't show up in the docs here:

http://developer.android.com/reference/android/widget/TabWidget.html

nor does it work if I try to use it in Eclipse. Am I doing something
wrong or was it hidden for some reason?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] No resource identifier found for attribute 'tabLayout' in package 'android'

2012-01-27 Thread Tor Norbye
The file public.xml in the same folder defines which attributes are API.

-- Tor

On Fri, Jan 27, 2012 at 6:13 PM, Grantland grantlandc...@gmail.com wrote:

 Is there any reason that the attribute android:tablayout isn't
 publicly available? I can find it in the source here:


 https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/attrs.xml#L2912

 but it doesn't show up in the docs here:

 http://developer.android.com/reference/android/widget/TabWidget.html

 nor does it work if I try to use it in Eclipse. Am I doing something
 wrong or was it hidden for some reason?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Unable to force stop apps which are device administrators on ICS

2012-01-27 Thread Jacob
[This is cross posted from android-platform, where it didn't get any
answers]

On my Nexus S running Android 4.0.3, I don't seem to be able to force
stop device admin apps. Specifically, Settings-Apps-All tab-My
Device Admin App leads to a display with the Force Stop button
grayed out/unavailable.  I could do this on Gingerbread 2.3.X -- the
app currently targets API 10 and works fine on the Nexus S running
2.3. Is this an intentional change in behavior? If so, is it
documented anywhere?

Thanks,

Jacob

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


[android-developers] I have a waring error

2012-01-27 Thread nashuwu
error is

[2012-01-28 09:32:24 - Emulator] WARNING: SD Card image already in
use: C:\Documents and Settings\hp\.android\avd\Gingerbread.avd/
sdcard.img

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


[android-developers] How to parse Json file (Which is output of http://maps.googleapis.com/maps/api/geocode/json.....)

2012-01-27 Thread Dhaval Varia
Dear All

I am using GEO-CODER for getting Address of place by Lat-Long.

But some times,

i get  Unable to parse output from server .

So i have decided to use following web service:

http://maps.googleapis.com/maps/api/geocode/json?latlng=22.508507985602836,73.474991977022533sensor=false

SO my question is :

1. Am i on right path?

2. How to parse output of this web-service for getting address of
location (Given as follows  which is in form of Json file)

/
{
   results : [
  {
 address_components : [
{
   long_name : Vadodara To Kevdi Eco Campsite,
   short_name : Vadodara To Kevdi Eco Campsite,
   types : [ route ]
},
{
   long_name : Halol,
   short_name : Halol,
   types : [ locality, political ]
},
{
   long_name : Panchmahal,
   short_name : Panchmahal,
   types : [ administrative_area_level_2, political ]
},
{
   long_name : Gujarat,
   short_name : Gujarat,
   types : [ administrative_area_level_1, political ]
},
{
   long_name : India,
   short_name : IN,
   types : [ country, political ]
}
 ],
 formatted_address : Vadodara To Kevdi Eco Campsite, Halol,
Gujarat, India,
 geometry : {
bounds : {
   northeast : {
  lat : 22.50734720,
  lng : 73.4720804999
   },
   southwest : {
  lat : 22.50672910,
  lng : 73.471657
   }
},
location : {
   lat : 22.50703820,
   lng : 73.4718693001
},
location_type : APPROXIMATE,
viewport : {
   northeast : {
  lat : 22.50838713029150,
  lng : 73.47321823029149
   },
   southwest : {
  lat : 22.50568916970850,
  lng : 73.47052026970849
   }
}
 },
 types : [ route ]
  },
  {
 address_components : [
{
   long_name : Halol,
   short_name : Halol,
   types : [ locality, political ]
},
{
   long_name : Panchmahal,
   short_name : Panchmahal,
   types : [ administrative_area_level_2, political ]
},
{
   long_name : Gujarat,
   short_name : Gujarat,
   types : [ administrative_area_level_1, political ]
},
{
   long_name : India,
   short_name : IN,
   types : [ country, political ]
}
 ],
 formatted_address : Halol, Gujarat, India,
 geometry : {
bounds : {
   northeast : {
  lat : 22.55368250,
  lng : 73.4858536999
   },
   southwest : {
  lat : 22.49457680,
  lng : 73.4473156999
   }
},
location : {
   lat : 22.5012610,
   lng : 73.4734880002
},
location_type : APPROXIMATE,
viewport : {
   northeast : {
  lat : 22.55368250,
  lng : 73.4858536999
   },
   southwest : {
  lat : 22.49457680,
  lng : 73.4473156999
   }
}
 },
 types : [ locality, political ]
  },
  {
 address_components : [
{
   long_name : Panchmahal,
   short_name : Panchmahal,
   types : [ administrative_area_level_2, political ]
},
{
   long_name : Gujarat,
   short_name : Gujarat,
   types : [ administrative_area_level_1, political ]
},
{
   long_name : India,
   short_name : IN,
   types : [ country, political ]
}
 ],
 formatted_address : Panchmahal, Gujarat, India,
 geometry : {
bounds : {
   northeast : {
  lat : 23.36486150,
  lng : 73.98468020
   },
   southwest : {
  lat : 22.22999730,
  lng : 73.3866118999
   }
},
location : {
   lat : 22.82086230,
   lng : 73.7477856999
},
location_type : APPROXIMATE,
viewport : {

Re: [android-developers] How to parse Json file (Which is output of http://maps.googleapis.com/maps/api/geocode/json.....)

2012-01-27 Thread Shubhangi
hello

first of all let me tell u regarding ur track for JSON parsing and getting
address using a web service is right..
now here I'm sending u code that how I am used to parse the JSON data.. All
you have to do is check this specified URL and change the rest of the code
according your requirements..

code is given below



ArrayListHashMapString, String mylist = new ArrayListHashMapString,
String();
JSONObject json = JSONfunctions.getJSONfromURL(
http://api.geonames.org/earthquakesJSON?north=44.1south=-9.9east=-22.4west=55.2username=demo
);
try{
JSONArray  earthquakes = json.getJSONArray(earthquakes);
for(int i=0;iearthquakes.length();i++){
HashMapString, String map = new HashMapString, String();
JSONObject e = earthquakes.getJSONObject(i);
 map.put(id,  String.valueOf(i));
 map.put(name, Earthquake name: + e.getString(eqid));
 map.put(magnitude, Magnitude:  +  e.getString(magnitude));
 mylist.add(map);
}
}catch(JSONException e){
 Log.e(log_tag, Error parsing data +e.toString());
}

ListAdapter adapter = new SimpleAdapter(this, mylist ,
R.layout.main,
new String[] { name, magnitude },
new int[] { R.id.item_title, R.id.item_subtitle });

setListAdapter(adapter);



-

let me know whether it works or not for you...

thank you

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

[android-developers] AutoScroll ListView at specified intervals without user intervention

2012-01-27 Thread Giants203
I would like to auto scroll list view at specified time intervals
without user intervention. The time intervals will be supplied in an
array on integers  say 1000, 4000, 5000 in millisecs

I want to show the first list item as soon as the list launches
and then wait 10 sec to show the next list item on top of the list
(visible on the screen) and so on based on the time intervals shown
above.

What's the best way to accomplish this?

I was going through this a href=http://groups.google.com/group/
android-beginners/browse_thread/thread/ea22a389eb900bbe?pli=1thread/
a  but the getListView().setSelection() is taking directly to the
end of the list. There is no incremental update happening.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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-01-27 Thread ajay talreja
Is that “View.OnClickListener”  listener only restricted to Layouts
i.e. button Events  etc  or it can be used to application click
event…….example when application is double clicked ,dialer gets opened
and when same application is single clicked , should get open...is it
possible…if yes….kindly help me with the code of the same…..
Other problems….


I have done coding to retrieve the latitude and longitude using gps
but its not workinglocation is showing null value and finally it
do not have any values of latitude and longitude.
I have tried passing the values from Emulator control and also through
command line using telnet local host 5554(device name).

Also same is the case with Google maps ,I have tried to access Google
maps but its not working via coding….i do have registered for Maps
key…..but I am able to access Google maps application from emulator
which is default present on emulator…I think so there is problem with
the code….

im providing u with the code GPS only ,‘ll try for Google maps
again.please go through it and reply sooner….

GPS
1) gps.java

package d.gps;

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


public class gps extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LocationManager locationManager;
locationManager =
(LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location location =
locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);

updateWithNewLocation(location);
}
/** Update UI with a new location */
private void updateWithNewLocation(Location location) {
  TextView myLocationText =
(TextView)findViewById(R.id.myLocationText);

  String latLongString;

  if (location != null) {
double lat = location.getLatitude();
double lng = location.getLongitude();
latLongString = Lat: + lat + \nLong: + lng;
  } else {
latLongString = No location found;
  }

  myLocationText.setText(Your Current Position is:\n +
latLongString);
}

}

2) main.xml
?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent

TextView
android:id=@+id/myLocationText
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello
  /
/LinearLayout


3)String.xml

?xml version=1.0 encoding=utf-8?
resources
string name=helloHello World, gps!/string
string name=app_namegps/string
/resources

4) androidmanifest.xml

?xml version=1.0 encoding=utf-8?
manifest xmlns:android=http://schemas.android.com/apk/res/android;
  package=d.gps
  android:versionCode=1
  android:versionName=1.0
application android:icon=@drawable/icon android:label=@string/
app_name
activity android:name=.gps
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity

/application
uses-sdk android:minSdkVersion=9 /
  uses-permission android:name=android.permission.INTERNET/uses-
permissionuses-permission
android:name=android.permission.ACCESS_FINE_LOCATION/

/manifest

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


Re: [android-developers] Dynamically populating LinearLayout in an AppWidget

2012-01-27 Thread TreKing
On Fri, Jan 27, 2012 at 6:00 PM, YuviDroid yuvidr...@gmail.com wrote:

 I think I had a similar problem some time ago...unfortunately I don't
 remember exactly how I solved. However I think I used
 RemoteViews.removeAllViews().


Thanks. That didn't work (actually led to the default could not load
widget error layout), but playing around with it a bit more I finally
found the problem.

As expected, I was missing something obvious: my linear_layout_entry
layout that I have been inflating had its height set to match_parent ...
So the first one was filling the parent and leaving no room for the rest
... I just couldn't tell due to the backgrounds being the same ...

*face palm*

Man I love posting to the group only to realize I'm being an idiot.

Thanks for the help!

-
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: android help

2012-01-27 Thread TreKing
On Sat, Jan 28, 2012 at 12:04 AM, ajay talreja ajayt...@gmail.com wrote:

 Is that “View.OnClickListener”  listener only restricted to Layouts
 i.e. button Events  etc


Yes. You can look through the docs to see where it's used.


 or it can be used to application click event…….example when application is
 double clicked ,dialer gets opened
 and when same application is single clicked , should get open...


There is no concept of clicking an application. You application, when
it's running, has some UI to display to the user - these UI elements can be
clicked, as described by the various listeners I linked you to.


 is it possible…if yes….kindly help me with the code of the same…..


Kindly explain what you're trying to do.


 I have done coding to retrieve the latitude and longitude using gps
  but its not workinglocation is showing null value and finally it
 do not have any values of latitude and longitude.


You need to explain this better. Maybe a SMALL sample of code where this is
not working.

-
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: Scroll View

2012-01-27 Thread TreKing
On Fri, Jan 27, 2012 at 3:38 PM, Oliviu Vais oliviu.v...@gmail.com wrote:

 I got this far, but this doesn't work.


You should generally explain what doesn't work means, but I can tell from
your code that you're locking the UI and getting an ANR, right?

You can't just do while (some condition that has just been set to true)
within the main thread. That puts you in an infinite loop and gets you
stuck. You need to do something like this:

onMotionEvent(View view)
{
 if (action down)
 {
  // Pressed down on a button, save it and start the scroll timer
(onTimerTick)
  viewClicked = view;
  startScrollTimer();
  }
 else if (action up)
  stopScrollTimer(); // Released the button, stop the timer (and thus the
scrolling)
}

onTimerTicker()
{
 if (viewClicked == left)
  scrollLeft();
 else if (viewClicked == right)
  scrollRight();
}

There are multiple ways to do the timer logic, Kostya showed you one.

-
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