Re: [android-developers] HttpUrlConnection issues

2016-06-05 Thread Jeffrey Nielsen
Thanks for the help there sport!

On Sun, Jun 5, 2016 at 2:26 AM, gjs  wrote:

> Use another thread
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Android Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-developers/aOaubqH7SgY/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/9acd0075-d7e5-4df8-bc41-c85cd0aef731%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CAC5M3kM-sYR8ZECu%3D8TdE7w5jRmsaK_zc%2BdMRh18k7zvkvO0%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] HttpUrlConnection issues

2016-06-04 Thread Jeffrey Nielsen
My API is 23. I am having issues where my device does not send the 
connection request. I have tried on the emulator, a phone running 6.0, and 
a tablet with 5.1.

Can someone please give me some assistance? Been banging my head against 
the wall for hours now.

import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.os.Bundle;
import android.widget.TextView;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;



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

final Button ConnectButton = (Button) findViewById(R.id.ConnectButton);
final TextView IpAddressEntry = (TextView) 
findViewById(R.id.IpAddressEntry);
final TextView PortEntry = (TextView) findViewById(R.id.PortEntry);
String IpAddress = IpAddressEntry.getText().toString();
String Port = PortEntry.getText().toString();

ConnectButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
HttpURLConnection connection = null;
String IpAddress = IpAddressEntry.getText().toString();
String Port = PortEntry.getText().toString();
try {
String urlConnect = "http://; + IpAddress + ":" + Port + 
"/connect";
URL url = new URL(urlConnect);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.connect();
Log.i(urlConnect, "myIP");
connection.setDoOutput(true);

InputStream is = connection.getInputStream();
BufferedReader reader =new BufferedReader(new 
InputStreamReader(is, "UTF-8"));
String webPage = "",data="";

while ((data = reader.readLine()) != null){
webPage += data + "\n";
}

} catch (Exception e) {

} finally {
if (connection != null) {
connection.disconnect();
}
}
}
});

}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/b5cac5a6-575c-43ab-8edf-9d58834aa51b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Captive portal for mobile hotspot

2012-10-21 Thread Jeffrey Orange
I am trying to find code to help me force those that connect to my hotspot 
from my Razr to a captive portal. Is this possible?

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

[android-developers] dragging Multiple object in Android

2012-10-12 Thread Jeffrey Bugahod
Hello guys, I am having hard time dealing with this project (Dragging 
Multiple Circle).

I already made it, it works when all the circle is at the leftmost top of 
the screen  but it seems not working when I started to re arrange the 
object using the graphical layout of main.xml 

are the circles have their own layout upon dragging? 

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

2012-09-05 Thread Jeffrey Fisher
If you still have a problem after installing drivers (but without a system 
restart) you may need to restart the adb server process.  Can't remember 
the exact name of it, but it wasn't hard to find, so probably contained 
adb.

System restart would get the job done too, but killing that process works.

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

[android-developers] Annoying shutter click undermines scientific research.

2012-09-02 Thread Jeffrey Peacock


I am involved in a project to use camera enabled Android devices to 
detect cosmic ray events ( 
http://www.distributedsensorweb.org/wiki/index.php/DECO). It is enjoying 
some modest funding from the American Physics Society and interest from 
Fermi Labs and Standford Univ.


The intent of the app is to run while the phone is plugged in and 
charging, like while the user is sleeping.  As such the shutter sound 
must be defeated.  In fact, even if you were running it on your desk 
while working the shutter sound is so annoying as to inspire you to 
reach for a hammer.


For most phones we have been able to make use of the mechanisms seen in 
previous posts:  mute streams and/or set volume to 0.  However, for a 
recent phone, the LG Optimus Elite (were using low cost Virgin Mobile 
devices as some of the test devices to reduce costs), none of the old 
tricks work:  the shutter sound always plays.  BUT!!!  I can download a 
camera app from the Google Play -- aptly named SilentCamera -- which 
will take pictures, well, silently.  And whatever solution it is 
employing is not using the MODIFY_AUDIO_SETTINGS permission.


I have already burned several hours researching and trying a variety of 
things.  As I've indicated I have tried muting and setting volume to 0 
for all streams, just before the camera.takePicture() call. And have 
tried to do the same in onShutter().  What I have learned is (according 
to the logs) that the camera is playing the shutter sound BEFORE the 
onShutter() call.


Obviously, I am hoping someone on the list can help.

Thanks.

/J

Note:  The LG Optimus Elite is running 2.3.7

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

2012-09-02 Thread Jeffrey Peacock


We've tried this.  The sound is so percussive (I think) that we only get 
a little relief.  Also, it won't work when we release the app to the 
wild as it is intended to be used by people all over the world to build 
a large scale observatory.  Mucking/altering the speaker of the phone 
isn't going to appeal to the widest possible audience.


/J

On 09/02/2012 02:40 PM, Fred Niggle wrote:
IF all else fails : put a plug of blu-tack or similar firmly into the 
hole the sounds comes from... it solved the proplem for myself, and 
its easy to remove with a toothpick !


On 2 September 2012 22:02, Jeffrey Peacock jeffp.ea...@gmail.com 
mailto:jeffp.ea...@gmail.com wrote:



I am involved in a project to use camera enabled Android devices
to detect cosmic ray events (
http://www.distributedsensorweb.org/wiki/index.php/DECO). It is
enjoying some modest funding from the American Physics Society and
interest from Fermi Labs and Standford Univ.

The intent of the app is to run while the phone is plugged in and
charging, like while the user is sleeping.  As such the shutter
sound must be defeated.  In fact, even if you were running it on
your desk while working the shutter sound is so annoying as to
inspire you to reach for a hammer.

For most phones we have been able to make use of the mechanisms
seen in previous posts:  mute streams and/or set volume to 0. 
However, for a recent phone, the LG Optimus Elite (were using low

cost Virgin Mobile devices as some of the test devices to reduce
costs), none of the old tricks work:  the shutter sound always
plays.  BUT!!!  I can download a camera app from the Google Play
-- aptly named SilentCamera -- which will take pictures, well,
silently. And whatever solution it is employing is not using the
MODIFY_AUDIO_SETTINGS permission.

I have already burned several hours researching and trying a
variety of things.  As I've indicated I have tried muting and
setting volume to 0 for all streams, just before the
camera.takePicture() call.  And have tried to do the same in
onShutter().  What I have learned is (according to the logs) that
the camera is playing the shutter sound BEFORE the onShutter() call.

Obviously, I am hoping someone on the list can help.

Thanks.

/J

Note:  The LG Optimus Elite is running 2.3.7
-- 
You received this message because you are subscribed to the Google

Groups Android Developers group.
To post to this group, send email to
android-developers@googlegroups.com
mailto:android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
Ubuntu Speech input 
https://play.google.com/store/apps/details?id=com.nds.ubuntuspeechinput 
is now available on Google Play, along with Magnetic Door Alarm app 
https://play.google.com/store/apps/details?id=com.nds.magneticdooralarm.


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

2012-09-02 Thread Jeffrey Peacock


Each of those is possible.  Going through the front door channel might
invoke more resistance as it would then be a kind-of official reply.  I
was hoping s/he might be on this list.

I'm also betting that someone here knows the answer.

/J

On 09/02/2012 02:49 PM, Kristopher Micinski wrote:

Jeff,

In the worst case scenario, you could just disassemble the app and
reverse engineer it...

In the best case scenario you should email the developer and ask him
how he's doing it, citing your research as why you need it (providing
proof you won't rip off his app, presumably)..

kris

On Sun, Sep 2, 2012 at 4:02 PM, Jeffrey Peacock jeffp.ea...@gmail.com wrote:

I am involved in a project to use camera enabled Android devices to detect
cosmic ray events (
http://www.distributedsensorweb.org/wiki/index.php/DECO).  It is enjoying
some modest funding from the American Physics Society and interest from
Fermi Labs and Standford Univ.

The intent of the app is to run while the phone is plugged in and charging,
like while the user is sleeping.  As such the shutter sound must be
defeated.  In fact, even if you were running it on your desk while working
the shutter sound is so annoying as to inspire you to reach for a hammer.

For most phones we have been able to make use of the mechanisms seen in
previous posts:  mute streams and/or set volume to 0.  However, for a recent
phone, the LG Optimus Elite (were using low cost Virgin Mobile devices as
some of the test devices to reduce costs), none of the old tricks work:  the
shutter sound always plays.  BUT!!!  I can download a camera app from the
Google Play -- aptly named SilentCamera -- which will take pictures, well,
silently.  And whatever solution it is employing is not using the
MODIFY_AUDIO_SETTINGS permission.

I have already burned several hours researching and trying a variety of
things.  As I've indicated I have tried muting and setting volume to 0 for
all streams, just before the camera.takePicture() call.  And have tried to
do the same in onShutter().  What I have learned is (according to the logs)
that the camera is playing the shutter sound BEFORE the onShutter() call.

Obviously, I am hoping someone on the list can help.

Thanks.

/J

Note:  The LG Optimus Elite is running 2.3.7

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

2012-09-02 Thread Jeffrey Peacock


Yup.  Sound plays through speaker anyway.  But thanks.  It shows people
are listening (pun intended) and helpful.

/J


On 09/02/2012 02:50 PM, RichardC wrote:

Have you tried inserting a headphone lead?



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

2012-07-09 Thread Jeffrey Brown
Yes but only if the receiving process knows how to unparcel the object.
On Jul 9, 2012 11:29 AM, Agus agus.sant...@gmail.com wrote:

 Can you send parcelable across processes without aidl ?

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

2012-06-12 Thread Jeffrey Hodes


I'm trying to implement a simple augmented reality tool for Android. All it 
needs to do is take as input my location and device orientation and the 
location of another device and present a camera view with an icon overlaid 
in the appropriate place in an appropriate size.

I'm stuck in two places:

I wrote code to get updates for the current azimuth, pitch, and roll of the 
device. The code looks like this:

private final SensorEventListener goodListener = new SensorEventListener() {
private float[] magneticValues;
private float[] accelerometerValues;

public void onAccuracyChanged(Sensor sensor, int accuracy) {
}

public void onSensorChanged(SensorEvent event) {
switch (event.sensor.getType()) {
case Sensor.TYPE_MAGNETIC_FIELD:
magneticValues = event.values.clone();
break;
case Sensor.TYPE_ACCELEROMETER:
accelerometerValues = event.values.clone();
break;
}

if (magneticValues != null  accelerometerValues != null) {
float[] outR = new float[9];
float[] orientationValues = new float[3];

SensorManager.getRotationMatrix(outR, null,
accelerometerValues, magneticValues);
SensorManager.getOrientation(outR, orientationValues);

double azimuth = Math.toDegrees(orientationValues[0]);
double pitch = Math.toDegrees(orientationValues[1]);
double roll = Math.toDegrees(orientationValues[2]);

}
}

When I use logging to read these values, they seem relatively stable, but 
they do not seem to correspond to angles around any natural set of axes, 
and I can't figure out what the numbers represent. How should I interpret 
these numbers?

The tutorial at http://www.devx.com/wireless/Article/42482/0/page/3 takes a 
much simpler approach, but I cannot get it to work.

Once I have my device's azimuth, pitch, and roll, along with my latitude 
and longitude and that of the other device, how can I determine where to 
put the icon on the screen? This seems to be a complicated geometry problem 
where we must imagine the view field of the camera as an infinite cone, 
project it onto the surface of the earth, and see if the other location is 
inside the projected area, but this seems awfully complicated. Is there a 
better way that I'm overlooking?
Thanks!

- Jeff

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

2012-04-26 Thread Jeffrey Chu
You need an OTA reader and a javacard tool to install applet to an SE.  To
install applet to PN65N, you also need the set of keys or public key to
generate an load/install token to get authorized to install.

Or, a simpler answer is no, you cannot do it because the keys are not
available.
On Apr 24, 2012 5:15 AM, 何斌斌 hbbs...@gmail.com wrote:

 HI All:

 Now I'm operating the SE of  PN65N chip, but I don't know how to
 install applet to SE by OTA,

 Can anyone help me?   Thanks very much.

 --
 binbin he
 Mobile: +86-18616626972
 Msn: hbbs...@hotmail.com

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

2011-12-20 Thread Jeffrey Dunbar
I am developing an app, I would like to use the power button as a
panic button. Is there a way to hook into and catch globally from a
service. I know that android fires the intent.action SCREEN_ON and
_OFF but this causes issues. I have a service that monitors for screen
on/off sets an alarm on first press to expire and reset a setting if
not hit 3 times in 1.5 seconds. There are times that this condition
can be met just by the normal power down of the screen. e.g. market is
downloading an app and screen goes to sleep, you wake up to check and
turn off the screen after checking

Any help greatly appreciated.

Jeff

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


[android-developers] Re: Regarding play audio files using SoundPool class

2011-12-20 Thread Jeffrey Dunbar
What requirements are you needing. I would suggest amrnb or ogg to
keep them small,
ogg for quality, never wav or mp3. I personally would put them in the
asset directory
it seemed to work better for my app

Jeff

On Dec 19, 11:15 pm, kumar varma kkvarm...@gmail.com wrote:
 I've created an application which uses around 40 small audio files.
 Right now I'm using mp3 files and each is around 250KB. These files
 are stored in my res/raw directory.
 I'm using SoundPool class to play the files in my application.

 Can one of you suggest what is the best way to store so many audio
 files? Will my application be scalable?
 Is wav or ogg format better approach instead of mp3? Please let me
 know. and one more doubt every time I wanna play  3 audio files one by
 one using SoundPool class can you
  please any one suggest me  to do this

 Thanks ,
 Kumar.

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


[android-developers] Using queueEvent for OpenGL

2011-08-18 Thread Jeffrey
Okay. In my project I am trying to have an OnTouchEvent cause a change
in my Renderer thread but I can't figure out how to get this working.
I was having the touch event change a boolean value to put the draw
method onto the proper trail for what to draw, but there is a 3 second
delay before it decides to check the boolean value. When I was working
with canvas I was able to do a Synchronized action with the
gamethread, but alas I cannot figure out how to get this to mesh with
my renderer, as there are several things I don't know how to
substitute.

Also, I am getting a bit tired of google's sample code not actually
being working code, and just an idea to work off. For example I want
to try to use queueEvent, but going off of this example:
http://android-developers.blogspot.com/2009/04/introducing-glsurfaceview.html

The code here

public boolean onTouchEvent(final MotionEvent event) {
queueEvent(new Runnable(){
public void run() {
mRenderer.setColor(event.getX() / getWidth(),
event.getY() / getHeight(), 1.0f);
}});
return true;
}

does not not work. I get the following error The method
queueEvent(new Runnable(){}) is undefined for the type Main and if I
make a method named that (which I don't think is what I should be
doing as the example listed doesn't do this) then all it's doing is
creating another method in the same thread and there is no progress
(correct me if I am wrong, and I am probably wrong).

I've tried looking for examples of how to use queueEvent and all I
can't find a proper explanation. Or if I could find an example of
syncing an Ontouchevent to the renderer thread then I could work from
there.

I don't have too great an understanding of a lot of things. I have
been stuck many times before on problems but I can usually figure them
out and eventually learn how they work. Basically I don't want to get
a generic You should learn Java/OpenGL/Whatever before you try this
as this is the last obstacle in my way (as far as I can see) before
all the rest of the work is math and logic, and I don't want to spend
money + time pouring over books for the answer to this question.

If someone could please help I would be grateful. I am also willing to
offer more information if needed.

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


[android-developers] Using a coordinate system in OpenGL

2011-08-09 Thread Jeffrey
I have tried to search for this but because of some of the generic
terms I've been coming up blank.

In many of the OpenGL tutorials I have seen they all show you how to
draw something in the middle of the screen but they never tell you
what the coordinates mean. I'm writing an app the is using a
surfaceview/onDraw() system and I want to know if there is anyway to
carry over my X/Y values into OpenGL.

Also at that rate (and I know this is probably a very dumb question)
what does the f denote when at the end of a number? Most OpenGL
coords are 2.0f or similiar and I don't know what that means. Please
assist.

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


[android-developers] Re: Using a coordinate system in OpenGL

2011-08-09 Thread Jeffrey
Okay, after a more specific search I realize that the f denotes a
float, what importance does that have? I have read that it can be left
off in situations but that was in a discussion about a different
programming language.

On Aug 9, 9:10 pm, Jeffrey jeffisagen...@gmail.com wrote:
 I have tried to search for this but because of some of the generic
 terms I've been coming up blank.

 In many of the OpenGL tutorials I have seen they all show you how to
 draw something in the middle of the screen but they never tell you
 what the coordinates mean. I'm writing an app the is using a
 surfaceview/onDraw() system and I want to know if there is anyway to
 carry over my X/Y values into OpenGL.

 Also at that rate (and I know this is probably a very dumb question)
 what does the f denote when at the end of a number? Most OpenGL
 coords are 2.0f or similiar and I don't know what that means. Please
 assist.

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


[android-developers] Re: Using a coordinate system in OpenGL

2011-08-09 Thread Jeffrey
Sorry, and as to my limited knowledge you are correct. I don't really
have a good understanding as the only reference I've had for Java is
an outdated For Dummies book, and the rest I've figured out as I go.

As to simplify my question: I often see OpenGL Coords listed as such
(0.0f, -2.0f, 0.0f, 2.0f) If I was using my the surfaceview coordinate
system this would be an incredibly small image, but the tutorial makes
a large image. I am guessing that 2.0f on an OpenGL coordinate plane
does not equal 2 on a surfaceview coordinate plane?

I'll even make this multiple choice:

A. 2.0f means something totally different than 2 and you should know
that.
B. OpenGL uses a relative Coordinate plane and surfaceView a fixed.
(Or something similar)
C. None of the above.
D. Other (please write in your answer)
E. Go ask somewhere else

Thanks in advance.

On Aug 9, 9:27 pm, TreKing treking...@gmail.com wrote:
 On Tue, Aug 9, 2011 at 9:16 PM, Jeffrey jeffisagen...@gmail.com wrote:
  Okay, after a more specific search I realize that the f denotes a float,
  what importance does that have?

 It's to be explicit and use a float type instead of a double type. No
 offense, but if you don't know this, sounds like you need to learn Java.

 As for your OpenGL question, this too is off-topic for this list. Try a
 group or forum dedicated to OpenGL - the concepts should be the same for
 regular GL and mobile. Be a little more specific wherever you do post, as
 your question is not even that clear.

 --- 
 --
 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: Using a coordinate system in OpenGL

2011-08-09 Thread Jeffrey
Thank you. That is all I needed to know. I will look into getting a
good OpenGL Book. Quick question though, if I'm targeting 2.2 and
above should I look towards a particular version or is most of the
code carried over to the point where I won't have a head full of wrong
information?

On Aug 9, 10:24 pm, Adam Ratana adam.rat...@gmail.com wrote:
 Definitely get an opengl book, old 1.1 books can be had very cheap from 
 amazon.  You can define the coordinate system, which is why you see what you 
 see there, but openGL is not something where you can just take code snippets 
 and plug and chug without understanding IMO, so you definitely want to be at 
 the point with it where you can understand each line of code you read, as its 
 procedural in nature, everything is specific.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: onDraw() causing flicker when drawing new images

2011-08-07 Thread Jeffrey
How would I go about doing that? I have no formal programming
education and everything I know is based of examples I've seen, and
I've never seen that done.

On Aug 7, 2:56 pm, Doug beafd...@gmail.com wrote:
 The logic for onDraw in any given View should be to draw the entire
 view every time it's called by the view hierarchy.

 Are you calling invalidate with a dirty region on your view to
 indicate only which portions of the view have changed from moment to
 moment?  That should speed up rendering because Android will try to
 optimize away any part of the drawing that lies outside the dirty
 rect.  If you're allowing every pixel in view to update on every call
 to onDraw, well, that can be expensive.

 Doug

 On Aug 6, 3:59 pm, Jeffrey jeffisagen...@gmail.com wrote:







  The problem isn't tearing, as the images shouldn't be drawn there yet
  anyway. I don't have my position calculations in a separate thread,
  should I? I have tried locking the array (though because of my limited
  knowledge I've gone about it probably the wrong way, by basically
  having a boolean that tells the draw cycle whether to read the data or
  not) but that didn't work, probably because of the poor quality of my
  attempt. I don't know too much about syncing threads and all that so
  I've been unable to figure this out on my own.

  On Aug 6, 12:19 pm, Miguel Morales therevolti...@gmail.com wrote:

   Perhaps you can try adding a synchronized lock that protects your data 
   array.
   Lock it before going into onDraw() and unlock it when finished, and do
   the same when calculating your array data.
   Do you have a separate thread that calculates positions?

   On Fri, Aug 5, 2011 at 6:23 PM, niko20 nikolatesl...@yahoo.com wrote:
Hm sounds like a refresh rate issue, with Surface view you probably
can't sync to vertical refresh, so you get tearing, where you see
halfway animations for a second as the video buffer changes over to
the next frame.

-niko

On Aug 5, 1:56 pm, Jeffrey jeffisagen...@gmail.com wrote:
I'm having an issue with drawing on my surface view. At one point I
was just replacing images with new ones in a grid, but the images
didn't all draw at the same time. I think that that may have had
something to do with modifying the array that it was using to
determine what to draw but I couldn't get it resolved even when
pausing the drawing. Now I have images that drop down and new ones
fall in (think slot machine reels) but the images will occasionally
flicker with what the new image is going to be before the old images
fall out.

Basically I guess I'm asking what is a good way to either pause the
onDraw command while I can edit my arrays and get them all in place or
what is a good way to sync my array modifications to not take place
during an onDraw cycle? Or is onDraw just bad at drawing images
simultaneously and I should be using OpenGL or something?

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

   --
   ~ Jeremiah:9:23-24
   Android 2D 
   MMORPG:http://solrpg.com/, http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: onDraw() causing flicker when drawing new images

2011-08-07 Thread Jeffrey
Okay, figured it out, syncing the touch event with the draw thread
cleared it up. I am still interested in calling invalidate on dirty
regions if it will increase performance though...

On Aug 7, 3:59 pm, Jeffrey jeffisagen...@gmail.com wrote:
 How would I go about doing that? I have no formal programming
 education and everything I know is based of examples I've seen, and
 I've never seen that done.

 On Aug 7, 2:56 pm, Doug beafd...@gmail.com wrote:







  The logic for onDraw in any given View should be to draw the entire
  view every time it's called by the view hierarchy.

  Are you calling invalidate with a dirty region on your view to
  indicate only which portions of the view have changed from moment to
  moment?  That should speed up rendering because Android will try to
  optimize away any part of the drawing that lies outside the dirty
  rect.  If you're allowing every pixel in view to update on every call
  to onDraw, well, that can be expensive.

  Doug

  On Aug 6, 3:59 pm, Jeffrey jeffisagen...@gmail.com wrote:

   The problem isn't tearing, as the images shouldn't be drawn there yet
   anyway. I don't have my position calculations in a separate thread,
   should I? I have tried locking the array (though because of my limited
   knowledge I've gone about it probably the wrong way, by basically
   having a boolean that tells the draw cycle whether to read the data or
   not) but that didn't work, probably because of the poor quality of my
   attempt. I don't know too much about syncing threads and all that so
   I've been unable to figure this out on my own.

   On Aug 6, 12:19 pm, Miguel Morales therevolti...@gmail.com wrote:

Perhaps you can try adding a synchronized lock that protects your data 
array.
Lock it before going into onDraw() and unlock it when finished, and do
the same when calculating your array data.
Do you have a separate thread that calculates positions?

On Fri, Aug 5, 2011 at 6:23 PM, niko20 nikolatesl...@yahoo.com wrote:
 Hm sounds like a refresh rate issue, with Surface view you probably
 can't sync to vertical refresh, so you get tearing, where you see
 halfway animations for a second as the video buffer changes over to
 the next frame.

 -niko

 On Aug 5, 1:56 pm, Jeffrey jeffisagen...@gmail.com wrote:
 I'm having an issue with drawing on my surface view. At one point I
 was just replacing images with new ones in a grid, but the images
 didn't all draw at the same time. I think that that may have had
 something to do with modifying the array that it was using to
 determine what to draw but I couldn't get it resolved even when
 pausing the drawing. Now I have images that drop down and new ones
 fall in (think slot machine reels) but the images will occasionally
 flicker with what the new image is going to be before the old images
 fall out.

 Basically I guess I'm asking what is a good way to either pause the
 onDraw command while I can edit my arrays and get them all in place 
 or
 what is a good way to sync my array modifications to not take place
 during an onDraw cycle? Or is onDraw just bad at drawing images
 simultaneously and I should be using OpenGL or something?

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

--
~ Jeremiah:9:23-24
Android 2D 
MMORPG:http://solrpg.com/, http://www.youtube.com/user/revoltingx

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: onDraw() causing flicker when drawing new images

2011-08-06 Thread Jeffrey
The problem isn't tearing, as the images shouldn't be drawn there yet
anyway. I don't have my position calculations in a separate thread,
should I? I have tried locking the array (though because of my limited
knowledge I've gone about it probably the wrong way, by basically
having a boolean that tells the draw cycle whether to read the data or
not) but that didn't work, probably because of the poor quality of my
attempt. I don't know too much about syncing threads and all that so
I've been unable to figure this out on my own.

On Aug 6, 12:19 pm, Miguel Morales therevolti...@gmail.com wrote:
 Perhaps you can try adding a synchronized lock that protects your data array.
 Lock it before going into onDraw() and unlock it when finished, and do
 the same when calculating your array data.
 Do you have a separate thread that calculates positions?









 On Fri, Aug 5, 2011 at 6:23 PM, niko20 nikolatesl...@yahoo.com wrote:
  Hm sounds like a refresh rate issue, with Surface view you probably
  can't sync to vertical refresh, so you get tearing, where you see
  halfway animations for a second as the video buffer changes over to
  the next frame.

  -niko

  On Aug 5, 1:56 pm, Jeffrey jeffisagen...@gmail.com wrote:
  I'm having an issue with drawing on my surface view. At one point I
  was just replacing images with new ones in a grid, but the images
  didn't all draw at the same time. I think that that may have had
  something to do with modifying the array that it was using to
  determine what to draw but I couldn't get it resolved even when
  pausing the drawing. Now I have images that drop down and new ones
  fall in (think slot machine reels) but the images will occasionally
  flicker with what the new image is going to be before the old images
  fall out.

  Basically I guess I'm asking what is a good way to either pause the
  onDraw command while I can edit my arrays and get them all in place or
  what is a good way to sync my array modifications to not take place
  during an onDraw cycle? Or is onDraw just bad at drawing images
  simultaneously and I should be using OpenGL or something?

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

 --
 ~ Jeremiah:9:23-24
 Android 2D MMORPG:http://solrpg.com/, http://www.youtube.com/user/revoltingx

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


[android-developers] onDraw() causing flicker when drawing new images

2011-08-05 Thread Jeffrey
I'm having an issue with drawing on my surface view. At one point I
was just replacing images with new ones in a grid, but the images
didn't all draw at the same time. I think that that may have had
something to do with modifying the array that it was using to
determine what to draw but I couldn't get it resolved even when
pausing the drawing. Now I have images that drop down and new ones
fall in (think slot machine reels) but the images will occasionally
flicker with what the new image is going to be before the old images
fall out.

Basically I guess I'm asking what is a good way to either pause the
onDraw command while I can edit my arrays and get them all in place or
what is a good way to sync my array modifications to not take place
during an onDraw cycle? Or is onDraw just bad at drawing images
simultaneously and I should be using OpenGL or something?

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


Re: [android-developers] EventQueue.peekMessage

2011-07-07 Thread Jeffrey Brown
You can use a Canvas to draw an image into a Bitmap on a background
thread.  Then when that's finished, draw the Bitmap into the View (in
onDraw) on the main thread.

I'd be worried about a drawing function that takes several seconds to
run.  We like to keep drawing well under 16ms in order to ensure a
good framerate and smooth animations.

Jeff.

On Thu, Jul 7, 2011 at 9:53 AM, andrei-dmitriev
andrei-dmitr...@yandex.ru wrote:
 The longRoutine is the drawing procedure which may take up to several
 seconds.

 Yep, I tried to relay that onto another thread and draw into the SurfaceView
 but the problem I've faced is that
 the original view(s) are still repainted with onDraw() thus the content (the
 background thread is rendering all the time) is missing. It's called from
 the deep android internals so I don't believe I trigger it somehow - it's
 just a reaction on the invalidate().
 Well, it is covered with blank rectangle but I can see the actual content
 under that rectangle.
 BTW that looks like a thread condition over there as sometimes (very rarely)
 I can see the content for a few moments which then becomes covered with
 background color.

 So far I also tried to:
 a) setWillNotDraw(true);
 b) unset the background color of the view

 Interestingly that in a sample application (a SurfaceView in a RelativeView)
 the b) approach does help and since that we don't have such a problem there.

 So the problem now could be read like this (I'm starting to think there is
 no way to peek events from the queue, right? :) :
 How to switch the SurfaceView's onDraw() method off?
 Any cluea of what can make it been called also appreciated.

 Thanks,
 Andrei


 07.07.2011 17:18, Mark Murphy пишет:

 On Thu, Jul 7, 2011 at 9:11 AM, andrei-dmitriev
 andrei-dmitr...@yandex.ru  wrote:

 why there is no a way to poll or peek the message from the event queue?
 I want it to implement the break for the routine running on the UI
 thread.
 private void longRoutine() {
    while (flag){
        if (queue.peekMessage() != null) {
            return;
        }
 whatever the code is
    }
 }

 Or am I missing something and actually a way exists?

 It's called a background thread. All the cool programmers use them.

 Why do you think that you need longRoutine() to be on the main
 application thread?


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


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


[android-developers] Re: Multi-touch pointer ids on Sony Xperia Play spurious ACTION_DOWN events

2011-05-19 Thread Jeffrey Brown
 than one move event within a 60Hrz 
 frame and then I will only

                      // sleep as much as I need.  It's very much along the 
 lines of a update loop.

                      long    currentTime = System.currentTimeMillis();

                      long    elapsed        = currentTime - 
 m_LastMoveEventTime;

                      if ( elapsed  16L )

                      {

                          try

                          {

                              Thread.sleep( Math.max( 0, 16L - elapsed ) );

                          }

                          catch( InterruptedException e )

                          {

                              Thread.currentThread().interrupt();

                          }

                          break;

                      }

                      for( int index = 0; index  numPointers; ++index )

                      {

                          ptrId = event.getPointerId( index );

                          if ( ptrId= 0 )

                          {

                              pe = (PointerEvent)m_PointerEvents.alloc();

                              if ( pe != null )

                              {

                                  pe.owner     = m_PointerEvents;

                                  pe.action    = PointerEvent.ACTION_DRAG;

                                  pe.id        = ptrId;

                                  pe.x        = (int)event.getX( index );

                                  pe.y        = (int)event.getY( index );

                                  m_App.getGame().postUIEvent( pe );

                                  //Log.v( POINTER, te.toString() );

                              }

                          }

                      }

                      m_LastMoveEventTime = currentTime;

                  }

                  break;

          }

          return true;

      }

 Leigh

 On 5/17/2011 2:01 AM, Jeffrey Brown wrote:









  Pointer IDs are arbitrary integers.  The only guarantee is that they
  will be unique for a given finger as long as that finger remains down.
    Once the finger goes up, the id may be reused for a different finger,
  or it may not.  It really depends.

  The problem with spurious ACTION_DOWN events is strictly a software
  issue, not hardware.  It happens when applications filter or modify
  the stream of touch events in a manner that causes them to become
  incomplete or inconsistent.  The bugs can be quite subtle.

  Jeff.

  On Mon, May 16, 2011 at 3:56 PM, MichaelEGRfoun...@egrsoftware.com  wrote:
  ugh!  Thanks for posting this message as this is a gnarly one and an
  example of ODM fragmentation if pointed IDs are not indexing correctly
  to the proper point data at least. I never was impressed by the
 multitouchAPI and always thought it wasn't thought out well and
  simply just tacked onto MotionEvent. Dirty as you say it is correct. I
  also wasn't pleased with the lack of documentation and unclear
  contract. Perhaps this lack of documentation led to this potential ODM
  fault. As for spurious ACTION_DOWN events this could be from varied
  quality of touchscreen hardware too.

  So from my reading of your post you are saying that pointer IDs are
  not recycled and that the data of subsequent pointer IDs is not
  correct at the specified array index?

  Not looking forward to coming up with a solution for my platform /
  middleware / custom event system and certainly am not excited if I
  need to buy an Experia Play just for this, but w/ talking with Robert
  G. it sounds like button support on this device is a bit wacky too. If
  I understand correctly button presses don't generate key events? Hrm;
  I hope that is not the case as I hate to have to waste $500+ to fix
  these kinds of issues. Likely I'll pick one up, fix the issues, then
  sell it.

  Regards,
  --Mike

  On May 16, 12:58 pm, Mario Zechnerbadlogicga...@gmail.com  wrote:
  A user reported an ArrayIndexOutOfBoundsException today in ourmulti- 
  touchhandler. We store x/y/touchState on a per pointer id basis in an
  array. Dirty? Yes, but it worked on all devices so far. Usually
  pointer ids are handed out like this:
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, send email to
  android-developers+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

 --
 Leigh McRaehttp://www.lonedwarfgames.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

Re: [android-developers] Re: Multi-touch pointer ids on Sony Xperia Play spurious ACTION_DOWN events

2011-05-17 Thread Jeffrey Brown
Pointer IDs are arbitrary integers.  The only guarantee is that they
will be unique for a given finger as long as that finger remains down.
 Once the finger goes up, the id may be reused for a different finger,
or it may not.  It really depends.

The problem with spurious ACTION_DOWN events is strictly a software
issue, not hardware.  It happens when applications filter or modify
the stream of touch events in a manner that causes them to become
incomplete or inconsistent.  The bugs can be quite subtle.

Jeff.

On Mon, May 16, 2011 at 3:56 PM, MichaelEGR foun...@egrsoftware.com wrote:
 ugh!  Thanks for posting this message as this is a gnarly one and an
 example of ODM fragmentation if pointed IDs are not indexing correctly
 to the proper point data at least. I never was impressed by the
 multitouch API and always thought it wasn't thought out well and
 simply just tacked onto MotionEvent. Dirty as you say it is correct. I
 also wasn't pleased with the lack of documentation and unclear
 contract. Perhaps this lack of documentation led to this potential ODM
 fault. As for spurious ACTION_DOWN events this could be from varied
 quality of touchscreen hardware too.

 So from my reading of your post you are saying that pointer IDs are
 not recycled and that the data of subsequent pointer IDs is not
 correct at the specified array index?

 Not looking forward to coming up with a solution for my platform /
 middleware / custom event system and certainly am not excited if I
 need to buy an Experia Play just for this, but w/ talking with Robert
 G. it sounds like button support on this device is a bit wacky too. If
 I understand correctly button presses don't generate key events? Hrm;
 I hope that is not the case as I hate to have to waste $500+ to fix
 these kinds of issues. Likely I'll pick one up, fix the issues, then
 sell it.

 Regards,
 --Mike

 On May 16, 12:58 pm, Mario Zechner badlogicga...@gmail.com wrote:
 A user reported an ArrayIndexOutOfBoundsException today in our multi-
 touch handler. We store x/y/touchState on a per pointer id basis in an
 array. Dirty? Yes, but it worked on all devices so far. Usually
 pointer ids are handed out like this:

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


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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-touch pointer ids on Sony Xperia Play spurious ACTION_DOWN events

2011-05-17 Thread Jeffrey Brown
Pointer ids should be considered to be arbitrary non-negative
integers.

The framework currently makes some assumptions about the range of
these ids, but applications must not, lest they be broken sometime in
the future.  Imagine a device that supports 60 simultaneous finger
touches.  It could happen.  :)

Moreover, the order in which pointer ids are assigned is completely
arbitrary.  It happens to be the case that on most devices, the first
pointer id assigned is 0.  However the first pointer id could be
anything.

This is especially the case when the Honeycomb touch splitting feature
is enabled (as it is by default for new applications).  Suppose the
user puts two fingers down within two different scrollable list views.
 The first finger might have id 0 and be delivered to a scrollable
list view on the left.  The second finger might have id 1 and be
delivered to a scrollable list view on the right.  From the
perspective of the right hand list view, the first pointer id it
received was 1, not 0.

So I'm sad to say that many applications are making incorrect
assumptions about pointer id values.  One common bug is to conflate
the meaning of the pointer id and pointer index values... crash!

I strongly recommend that you track pointers using a sparse data
structure like a map or android.util.SparseArray.


Now let's talk about MotionEvent.ACTION_DOWN.  The framework
guarantees that motion events will always be delivered to a window in
a consistent sequence: down/move/up, down/cancel,
down/pointerdown/move/pointerup/up.

However, the framework cannot work around buggy views that drop or
corrupt part of the motion event stream before passing motion events
down to their children.

I've seen some custom views that do bad things like eat all multitouch
events, or intercept some part of the gesture without canceling the
rest.  OnTouchListener implementations can also be problematic if they
consume part but not all of a gesture.  Views downstream may receive
weird sequences of events as a result.

As a defensive coding practice, views should be implemented to always
reset themselves to a known ground state before handling ACTION_DOWN.
In this way, they can recover in case some of their ancestor views
fail to pass along the ACTION_UP or ACTION_CANCEL as would be
expected.

Likewise, bad things can happen during a gesture such as a pointer id
mysteriously vanishing from the event without a an ACTION_POINTER_UP
ever have been seen (because it was consumed somewhere else).  Views
should always check the result of MotionEvent.findPointerIndex and
handle the case where a pointer went missing.  Otherwise, the
application may crash when it tries to access a pointer with index -1.

Clearly if any of these things happen, there's a bug somewhere
(probably in the app).  It might not be very obvious though.  With a
little case, the app should be able to recover gracefully.

Hope that helps,
Jeff.

On May 16, 12:58 pm, Mario Zechner badlogicga...@gmail.com wrote:
 A user reported an ArrayIndexOutOfBoundsException today in 
 ourmulti-touchhandler. We store x/y/touchState on a per pointer id basis in an
 array. Dirty? Yes, but it worked on all devices so far. Usually
 pointer ids are handed out like this:

 first finger goes down - pointer Id 0
 second finger goes down - pointer id 1
 second finger lifted
 second finger goes down - pointer id 1
 second finger lifted
 second finger goes down - pointer id 1

 This works on all phones and some discussions in this group also point
 out this exact behaviour. Sadly, MotionEvent is underdocumented so it
 seems this was an assumption after all, not a rule all manufacturers
 would follow. On the Sony Xperia Play the following behaviour is
 observed.

 first finger goes down - pointer Id 0
 second finger goes down - pointer id 1
 second finger lifted
 second finger goes down - pointer id 2
 second finger lifted
 second finger goes down - pointer id 3

 Is this a bug in the Xperia touch driver or is this actually wanted
 behaviour? Did we all (and there are a couple of people i know of
 having this issue) created faulty apps based on a wrong assumption?

 On a related note: The MotionEvent documentation has a new addition
 which reads like this:

 The view implementation should be prepared to handle ACTION_CANCEL
 and should tolerate anomalous situations such as receiving a new
 ACTION_DOWN without first having received an ACTION_UP for the prior
 gesture.

 The handling of ACTION_CANCEL is a no-brainer of course. What is
 making me a bit nervous is the fact that spurious ACTION_DOWN events
 can now happen. It is not clear whether this will only happen if a
 parent View consumed the accompanying ACTION_UP event or if this is
 behaviour to be expected even in single View applications.

 Any pointers would be appreciated, no pun intended.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to 

[android-developers] Re: Multi-touch pointer ids on Sony Xperia Play spurious ACTION_DOWN events

2011-05-17 Thread Jeffrey Brown
Pointer IDs are arbitrary integers.  The only guarantee is that they
will be unique for a given finger as long as that finger remains down.
 Once the finger goes up, the id may be reused for a different finger,
or it may not.  It really depends.

The problem with spurious ACTION_DOWN events is strictly a software
issue, not hardware.  It happens when applications filter or modify
the stream of touch events in a manner that causes them to become
incomplete or inconsistent.  The bugs can be quite subtle.

Jeff.

On May 16, 3:56 pm, MichaelEGR foun...@egrsoftware.com wrote:
 ugh!  Thanks for posting this message as this is a gnarly one and an
 example of ODM fragmentation if pointed IDs are not indexing correctly
 to the proper point data at least. I never was impressed by themultitouchAPI 
 and always thought it wasn't thought out well and
 simply just tacked onto MotionEvent. Dirty as you say it is correct. I
 also wasn't pleased with the lack of documentation and unclear
 contract. Perhaps this lack of documentation led to this potential ODM
 fault. As for spurious ACTION_DOWN events this could be from varied
 quality of touchscreen hardware too.

 So from my reading of your post you are saying that pointer IDs are
 not recycled and that the data of subsequent pointer IDs is not
 correct at the specified array index?

 Not looking forward to coming up with a solution for my platform /
 middleware / custom event system and certainly am not excited if I
 need to buy an Experia Play just for this, but w/ talking with Robert
 G. it sounds like button support on this device is a bit wacky too. If
 I understand correctly button presses don't generate key events? Hrm;
 I hope that is not the case as I hate to have to waste $500+ to fix
 these kinds of issues. Likely I'll pick one up, fix the issues, then
 sell it.

 Regards,
 --Mike

 On May 16, 12:58 pm, Mario Zechner badlogicga...@gmail.com wrote:







  A user reported an ArrayIndexOutOfBoundsException today in ourmulti- 
  touchhandler. We store x/y/touchState on a per pointer id basis in an
  array. Dirty? Yes, but it worked on all devices so far. Usually
  pointer ids are handed out like this:

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


[android-developers] adb blocks while attempting to connect to server (during most commands)

2011-04-01 Thread Jeffrey Griffin
adb is sometimes blocking while trying to connect via loopback to the adb 
server. Here is a stack trace from gdb while using the froyo branch:

#0  0xf7fdc430 in __kernel_vsyscall ()
#1  0xf7f5ced1 in connect () from /lib32/libpthread.so.0
#2  0x0805e399 in socket_loopback_client (port=value optimized out, 
type=1) at system/core/libcutils/socket_loopback_client.c:51
#3  0x080521e3 in _adb_connect (service=0x80612ce host:version) at 
system/core/adb/adb_client.c:177
#4  0x080525d5 in adb_connect (service=0xc538 host:devices) at 
system/core/adb/adb_client.c:204
#5  0x0805285e in adb_query (service=0xc538 host:devices) at 
system/core/adb/adb_client.c:291
#6  0x08050ff3 in adb_commandline (argc=1, argv=0xd628) at 
system/core/adb/commandline.c:849
#7  0x0804ab62 in main (argc=2, argv=0xd624) at 
system/core/adb/adb.c:1176

Here is the connect syscall from socket_loopback_client.c which is blocking 
adb:

int socket_loopback_client(int port, int type)
{
struct sockaddr_in addr;
socklen_t alen;
int s;
memset(addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
s = socket(AF_INET, type, 0);
if(s  0) return -1;
=  if(connect(s, (struct sockaddr *) addr, sizeof(addr))  0) {
close(s);
return -1;
}
return s;
}

Anyone have any ideas as to whats going on? adb used to work properly. It is 
probably a system setup or library upgrade thing. Or maybe a routing problem 
on my machine? Any suggestions? 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] adb freezes while attempting to connect to server (during most commands)

2011-03-31 Thread Jeffrey Griffin
adb is freezing while trying to connect via loopback to the adb server. Here 
is a stack trace from gdb while using the froyo branch:

#0  0xf7fdc430 in __kernel_vsyscall ()
#1  0xf7f5ced1 in connect () from /lib32/libpthread.so.0
#2  0x0805e399 in socket_loopback_client (port=value optimized out, 
type=1) at system/core/libcutils/socket_loopback_client.c:51
#3  0x080521e3 in _adb_connect (service=0x80612ce host:version) at 
system/core/adb/adb_client.c:177
#4  0x080525d5 in adb_connect (service=0xc538 host:devices) at 
system/core/adb/adb_client.c:204
#5  0x0805285e in adb_query (service=0xc538 host:devices) at 
system/core/adb/adb_client.c:291
#6  0x08050ff3 in adb_commandline (argc=1, argv=0xd628) at 
system/core/adb/commandline.c:849
#7  0x0804ab62 in main (argc=2, argv=0xd624) at 
system/core/adb/adb.c:1176

Here is the connect syscall from socket_loopback_client.c which is blocking 
adb:

int socket_loopback_client(int port, int type)
{
struct sockaddr_in addr;
socklen_t alen;
int s;
memset(addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(port);
addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
s = socket(AF_INET, type, 0);
if(s  0) return -1;
=  if(connect(s, (struct sockaddr *) addr, sizeof(addr))  0) {
close(s);
return -1;
}
return s;
}

Anyone have any ideas as to whats going on? adb used to work properly. It is 
probably a system setup / library upgrade thing. 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] Issue passing context

2011-03-29 Thread Jeffrey
So I'm trying to use openGl to draw an image for a live wallpaper,
using the below method:

https://github.com/markfguerra/GLWallpaperService

And to draw then image Im referencing the foloowimg tutorial:

http://obviam.net/index.php/texture-mapping-opengl-android-displaying-images-using-opengl-and-squares/

The only problem I'm having is the very last part, passing the context
to the square object, because I'm not loading a GLSurfaceview. I've
tried to figure this out myself but my low knowledge of android is
making it difficult. Please help.

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


[android-developers] Re: Issue passing context

2011-03-29 Thread Jeffrey
The issue is with the last part of the second link, also the xoom
needs better autocorrect...

On Mar 29, 4:38 pm, Jeffrey jeffisagen...@gmail.com wrote:
 So I'm trying to use openGl to draw an image for a live wallpaper,
 using the below method:

 https://github.com/markfguerra/GLWallpaperService

 And to draw then image Im referencing the foloowimg tutorial:

 http://obviam.net/index.php/texture-mapping-opengl-android-displaying...

 The only problem I'm having is the very last part, passing the context
 to the square object, because I'm not loading a GLSurfaceview. I've
 tried to figure this out myself but my low knowledge of android is
 making it difficult. Please help.

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


[android-developers] Re: Issue passing context

2011-03-29 Thread Jeffrey
Sorry, the issue is the last part of the second link. Also, Xoom needs
better auto correct...

On Mar 29, 4:38 pm, Jeffrey jeffisagen...@gmail.com wrote:
 So I'm trying to use openGl to draw an image for a live wallpaper,
 using the below method:

 https://github.com/markfguerra/GLWallpaperService

 And to draw then image Im referencing the foloowimg tutorial:

 http://obviam.net/index.php/texture-mapping-opengl-android-displaying...

 The only problem I'm having is the very last part, passing the context
 to the square object, because I'm not loading a GLSurfaceview. I've
 tried to figure this out myself but my low knowledge of android is
 making it difficult. Please help.

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

2011-03-22 Thread Jeffrey
I only have one image rendered (the background image) and I get the
exact same results from canvas.translate() vs .drawbitmap.  The
problem seems to be either the time it takes for it to draw the
bitmap, or the time it takes to run through the sin/cos formulas for
the placement. The image is only a little larger than my phone's
display (800 X 480) but I get the same results when drawing a 50x50px
image.

This is my animation loop:

int Speed = 50;
double speedScale = (float) ((0.001*2*Math.PI)/Speed);
double Dist = SystemClock.elapsedRealtime() * speedScale;

NewX = (int) (OffsetX + Math.sin(Dist)*19);
NewY = (int) (OffsetY + Math.cos(Dist)*19);

c.drawBitmap(mBackground, NewX + OffsetX, NewY + OffsetY,
null);



On Mar 21, 10:28 pm, Peter Webb r.peter.w...@gmail.com wrote:
 I don't think OpenGL will help.

 I use canvas.translate and canvas.rotate extensively in my wallpaper,
 which runs very smoothly. AFAIK these commands just set mostly
 hardware flags for where to draw, and appear to execute
 instantaneously.

 You haven't posted any code, but I would make a bet on why it is
 running at 3fps.

 You are displaying images. I bet you do a jpeg rendering every time
 through your animation loop, and this is what is killing your
 performance.

 Draw the image to a bitmap, only once at the start (when a new image
 is first to be displayed). Persist it for the liefetime of the
 animation loop. Only do another jpeg rendering when you have a new
 image to display.

 In your animation loop:

 Translate the canvas
 Draw the bitmap
 Translate the canvas back

 If you have checked and you are *not* doing jpeg rendering in your
 animation loop then you should find out what line is causing your 300
 mS delay (shouldn't be too hard!) and fix that.

 Peter Webb

 On Mar 22, 7:58 am, Jeffrey jeffisagen...@gmail.com wrote:







  I am not getting any speed improvements over just changing the top/
  left coordinates of the .drawbitmap() command. I'm going to look into
  using OpenGL as I think part of my problem is the (relatively) low
  resolution makes even fluid movement seem choppy when it's moving by 1
  pixel increments.

  On Mar 20, 11:35 pm, Peter Webb r.peter.w...@gmail.com wrote:

   Call canvas.translate(-x), draw, then call canvas.translate(x)

   You are moving the location on the canvas underneath where you draw,
   after you have drawn whatever you need to move the canvas back.

   On Mar 21, 8:47 am, Jeffrey jeffisagen...@gmail.com wrote:

Is there a way around having to call canvas.drawbitmap() every time?
And if I call canvas.translate() after drawing the image doesn't move,
it instead moves everything that would draw *after* the call to
canvas.translate().

Thank you for your help so far, and I'm hoping you have just a little
bit left in you :)

On Mar 20, 9:12 am, Riyad Kalla rka...@gmail.com wrote:

 Jeffrey,

 To what Peter said, mobile devices are very fill-rate-limited (at
 least these current gen of phones) so depending on how you are
 repainting that image over and over and over again to the Canvas, that
 could explain the speed issue.

 If you tried a tiny little 16x16 icon and it went much faster with the
 same code, then I think you've found your culprit.

 Regardless, Peter's approach sounds like the right way; upload image
 data to the GPU one, then just move your view of it around in a
 circle, panning across the image.

 On Mar 19, 3:07 pm, Jeffrey jeffisagen...@gmail.com wrote:

  I'm trying to make a simple (or so I thought) live wallpaper that
  takes an image and moves it slowly in a circular motion, to make the
  picture seem less static and more like looking out a window. I took
  the live wallpaper tutorial from the SDK and stripped it down to the
  bare bones so I could add to it. But the issue is that no matter 
  what
  size the image I'm moving, or what format (drawable or bitmap), it 
  is
  only getting about 3 fps.

  I don't know what to do to make this run faster, I have very limited
  programming knowledge so I don't know if I'm missing something 
  stupid.

  Also, this is the code I'm using to calculate the circular movement:

  int NewX = (int) (OffsetX + Math.sin(Dist)*19);
  int NewY = (int) (OffsetY + Math.cos(Dist)*19);

  where Dist is the speed it's moving and 19 is the radius of the
  circle.

  Is there an easier way? I looked into Tween animation but I don't 
  know
  how I would implement my circle code into it.- Hide quoted text -

- Show quoted text -- Hide quoted text -

  - Show quoted text -

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

[android-developers] Re: Canvas frame rate very choppy in Live Wallpaper

2011-03-22 Thread Jeffrey
Also, the entire animation loop is almost instantly, the problem comes
from the Handler.postDelayed() not calling on time, no matter what I
set the desired FPS at, I can't get above 6 FPS, and I no longer think
it has anything to do my drawing code but maybe the way something else
is handled. I stripped down google's example livewallpaper, so I don't
know if it's lacking any optimizations or anything.

On Mar 22, 8:28 pm, Jeffrey jeffisagen...@gmail.com wrote:
 I only have one image rendered (the background image) and I get the
 exact same results from canvas.translate() vs .drawbitmap.  The
 problem seems to be either the time it takes for it to draw the
 bitmap, or the time it takes to run through the sin/cos formulas for
 the placement. The image is only a little larger than my phone's
 display (800 X 480) but I get the same results when drawing a 50x50px
 image.

 This is my animation loop:

                 int Speed = 50;
                 double speedScale = (float) ((0.001*2*Math.PI)/Speed);
                 double Dist = SystemClock.elapsedRealtime() * speedScale;

                 NewX = (int) (OffsetX + Math.sin(Dist)*19);
                 NewY = (int) (OffsetY + Math.cos(Dist)*19);

             c.drawBitmap(mBackground, NewX + OffsetX, NewY + OffsetY,
 null);

 On Mar 21, 10:28 pm, Peter Webb r.peter.w...@gmail.com wrote:







  I don't think OpenGL will help.

  I use canvas.translate and canvas.rotate extensively in my wallpaper,
  which runs very smoothly. AFAIK these commands just set mostly
  hardware flags for where to draw, and appear to execute
  instantaneously.

  You haven't posted any code, but I would make a bet on why it is
  running at 3fps.

  You are displaying images. I bet you do a jpeg rendering every time
  through your animation loop, and this is what is killing your
  performance.

  Draw the image to a bitmap, only once at the start (when a new image
  is first to be displayed). Persist it for the liefetime of the
  animation loop. Only do another jpeg rendering when you have a new
  image to display.

  In your animation loop:

  Translate the canvas
  Draw the bitmap
  Translate the canvas back

  If you have checked and you are *not* doing jpeg rendering in your
  animation loop then you should find out what line is causing your 300
  mS delay (shouldn't be too hard!) and fix that.

  Peter Webb

  On Mar 22, 7:58 am, Jeffrey jeffisagen...@gmail.com wrote:

   I am not getting any speed improvements over just changing the top/
   left coordinates of the .drawbitmap() command. I'm going to look into
   using OpenGL as I think part of my problem is the (relatively) low
   resolution makes even fluid movement seem choppy when it's moving by 1
   pixel increments.

   On Mar 20, 11:35 pm, Peter Webb r.peter.w...@gmail.com wrote:

Call canvas.translate(-x), draw, then call canvas.translate(x)

You are moving the location on the canvas underneath where you draw,
after you have drawn whatever you need to move the canvas back.

On Mar 21, 8:47 am, Jeffrey jeffisagen...@gmail.com wrote:

 Is there a way around having to call canvas.drawbitmap() every time?
 And if I call canvas.translate() after drawing the image doesn't move,
 it instead moves everything that would draw *after* the call to
 canvas.translate().

 Thank you for your help so far, and I'm hoping you have just a little
 bit left in you :)

 On Mar 20, 9:12 am, Riyad Kalla rka...@gmail.com wrote:

  Jeffrey,

  To what Peter said, mobile devices are very fill-rate-limited (at
  least these current gen of phones) so depending on how you are
  repainting that image over and over and over again to the Canvas, 
  that
  could explain the speed issue.

  If you tried a tiny little 16x16 icon and it went much faster with 
  the
  same code, then I think you've found your culprit.

  Regardless, Peter's approach sounds like the right way; upload image
  data to the GPU one, then just move your view of it around in a
  circle, panning across the image.

  On Mar 19, 3:07 pm, Jeffrey jeffisagen...@gmail.com wrote:

   I'm trying to make a simple (or so I thought) live wallpaper that
   takes an image and moves it slowly in a circular motion, to make 
   the
   picture seem less static and more like looking out a window. I 
   took
   the live wallpaper tutorial from the SDK and stripped it down to 
   the
   bare bones so I could add to it. But the issue is that no matter 
   what
   size the image I'm moving, or what format (drawable or bitmap), 
   it is
   only getting about 3 fps.

   I don't know what to do to make this run faster, I have very 
   limited
   programming knowledge so I don't know if I'm missing something 
   stupid.

   Also, this is the code I'm using to calculate the circular 
   movement:

   int NewX = (int) (OffsetX + Math.sin

[android-developers] Re: Canvas frame rate very choppy in Live Wallpaper

2011-03-21 Thread Jeffrey
I am not getting any speed improvements over just changing the top/
left coordinates of the .drawbitmap() command. I'm going to look into
using OpenGL as I think part of my problem is the (relatively) low
resolution makes even fluid movement seem choppy when it's moving by 1
pixel increments.

On Mar 20, 11:35 pm, Peter Webb r.peter.w...@gmail.com wrote:
 Call canvas.translate(-x), draw, then call canvas.translate(x)

 You are moving the location on the canvas underneath where you draw,
 after you have drawn whatever you need to move the canvas back.

 On Mar 21, 8:47 am, Jeffrey jeffisagen...@gmail.com wrote:







  Is there a way around having to call canvas.drawbitmap() every time?
  And if I call canvas.translate() after drawing the image doesn't move,
  it instead moves everything that would draw *after* the call to
  canvas.translate().

  Thank you for your help so far, and I'm hoping you have just a little
  bit left in you :)

  On Mar 20, 9:12 am, Riyad Kalla rka...@gmail.com wrote:

   Jeffrey,

   To what Peter said, mobile devices are very fill-rate-limited (at
   least these current gen of phones) so depending on how you are
   repainting that image over and over and over again to the Canvas, that
   could explain the speed issue.

   If you tried a tiny little 16x16 icon and it went much faster with the
   same code, then I think you've found your culprit.

   Regardless, Peter's approach sounds like the right way; upload image
   data to the GPU one, then just move your view of it around in a
   circle, panning across the image.

   On Mar 19, 3:07 pm, Jeffrey jeffisagen...@gmail.com wrote:

I'm trying to make a simple (or so I thought) live wallpaper that
takes an image and moves it slowly in a circular motion, to make the
picture seem less static and more like looking out a window. I took
the live wallpaper tutorial from the SDK and stripped it down to the
bare bones so I could add to it. But the issue is that no matter what
size the image I'm moving, or what format (drawable or bitmap), it is
only getting about 3 fps.

I don't know what to do to make this run faster, I have very limited
programming knowledge so I don't know if I'm missing something stupid.

Also, this is the code I'm using to calculate the circular movement:

int NewX = (int) (OffsetX + Math.sin(Dist)*19);
int NewY = (int) (OffsetY + Math.cos(Dist)*19);

where Dist is the speed it's moving and 19 is the radius of the
circle.

Is there an easier way? I looked into Tween animation but I don't know
how I would implement my circle code into it.- Hide quoted text -

  - Show quoted text -

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


[android-developers] Re: Canvas frame rate very choppy in Live Wallpaper

2011-03-20 Thread Jeffrey
Is there a way around having to call canvas.drawbitmap() every time?
And if I call canvas.translate() after drawing the image doesn't move,
it instead moves everything that would draw *after* the call to
canvas.translate().

Thank you for your help so far, and I'm hoping you have just a little
bit left in you :)

On Mar 20, 9:12 am, Riyad Kalla rka...@gmail.com wrote:
 Jeffrey,

 To what Peter said, mobile devices are very fill-rate-limited (at
 least these current gen of phones) so depending on how you are
 repainting that image over and over and over again to the Canvas, that
 could explain the speed issue.

 If you tried a tiny little 16x16 icon and it went much faster with the
 same code, then I think you've found your culprit.

 Regardless, Peter's approach sounds like the right way; upload image
 data to the GPU one, then just move your view of it around in a
 circle, panning across the image.

 On Mar 19, 3:07 pm, Jeffrey jeffisagen...@gmail.com wrote:







  I'm trying to make a simple (or so I thought) live wallpaper that
  takes an image and moves it slowly in a circular motion, to make the
  picture seem less static and more like looking out a window. I took
  the live wallpaper tutorial from the SDK and stripped it down to the
  bare bones so I could add to it. But the issue is that no matter what
  size the image I'm moving, or what format (drawable or bitmap), it is
  only getting about 3 fps.

  I don't know what to do to make this run faster, I have very limited
  programming knowledge so I don't know if I'm missing something stupid.

  Also, this is the code I'm using to calculate the circular movement:

  int NewX = (int) (OffsetX + Math.sin(Dist)*19);
  int NewY = (int) (OffsetY + Math.cos(Dist)*19);

  where Dist is the speed it's moving and 19 is the radius of the
  circle.

  Is there an easier way? I looked into Tween animation but I don't know
  how I would implement my circle code into it.

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


[android-developers] Canvas frame rate very choppy in Live Wallpaper

2011-03-19 Thread Jeffrey
I'm trying to make a simple (or so I thought) live wallpaper that
takes an image and moves it slowly in a circular motion, to make the
picture seem less static and more like looking out a window. I took
the live wallpaper tutorial from the SDK and stripped it down to the
bare bones so I could add to it. But the issue is that no matter what
size the image I'm moving, or what format (drawable or bitmap), it is
only getting about 3 fps.

I don't know what to do to make this run faster, I have very limited
programming knowledge so I don't know if I'm missing something stupid.

Also, this is the code I'm using to calculate the circular movement:

int NewX = (int) (OffsetX + Math.sin(Dist)*19);
int NewY = (int) (OffsetY + Math.cos(Dist)*19);


where Dist is the speed it's moving and 19 is the radius of the
circle.

Is there an easier way? I looked into Tween animation but I don't know
how I would implement my circle code into it.

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


Re: [android-developers] What is Failed to finish input event. Check logs for details. Runtime crash?

2011-03-02 Thread Jeffrey Brown
What else appears in the log?  Usually this message is preceded (or shortly
followed) by a log entry to the effect that the input event has already been
finished or the input channel was closed, or something.

Jeff.

On Mon, Feb 28, 2011 at 9:06 AM, Pink sivareddy.j...@gmail.com wrote:

 Hi,

   I am working on ginger bread.

   I am porting an application which was running properly on Foryo to
 GingerBread.

   While close one of my application activities i am getting RunTime
 exception.

   Can any body help me?


  The logcat as follows.

  java.lang.RuntimeException: Failed to finish input event.  Check
 logs for details.
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.view.InputQueue.nativeFinished(Native Method)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.view.InputQueue.access$100(InputQueue.java:26)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at android.view.InputQueue
 $FinishedCallback.run(InputQueue.java:165)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.view.ViewRoot.finishInputEvent(ViewRoot.java:2064)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.view.ViewRoot.handleMessage(ViewRoot.java:1890)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.os.Handler.dispatchMessage(Handler.java:99)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.os.Looper.loop(Looper.java:123)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 android.app.ActivityThread.main(ActivityThread.java:3661)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 java.lang.reflect.Method.invokeNative(Native Method)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 java.lang.reflect.Method.invoke(Method.java:507)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:842)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
 03-01 01:15:51.583 E/AndroidRuntime(  422): at
 dalvik.system.NativeStart.main(Native Method)


 Thanks in advance.

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


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

Re: [android-developers] Manually Dispatch Key Event

2011-02-22 Thread Jeffrey Brown
You need to set the MetaState flags of the KeyEvent for the comma to
META_SHIFT_ON.

However, I strongly discourage injecting key events if at all possible since
it tends to be brittle.

For example, you are probably assuming that shift-, produces  but there is
no guarantee that the keymap will be defined that way.

Jeff.

On Feb 17, 2011 12:31 PM, Ankur Avlani ankuravl...@gmail.com wrote:

 Hi All,

 I am trying to Manually dispatch Shift and Comma key from Android to my
webview, my code is as follows:

 KeyEvent event1 = new
KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_SHIFT_LEFT);
 boolean isFlag = dispatchKeyEvent(event1);
 KeyEvent event2 = new
KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_COMMA);
 dispatchKeyEvent(event2);
 KeyEvent event3 = new
KeyEvent(KeyEvent.ACTION_UP,KeyEvent.KEYCODE_SHIFT_LEFT);
 dispatchKeyEvent(event3);
 But the issue is, its sending the key one by one, i want it to send
Shift, key event to webview.  Any ideas what needs to be corrected?.  I
tried googling, but couldnt find any relevant solution.

 Any inputs are appreciated.

 Thanks,
 Anlkur

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Setting Alpha for an imageView in a homescreen widget

2011-02-22 Thread Jeffrey
I have traversed the internet and have yet to find an answer for this
problem. I have a set of image resources that I use in my widget, I
need to be able to reuse them but with differing Alpha levels. So far
the only command I can find to change alpha levels is .setAlpha(), but
that will not work as I am having to dispatch the image
via .setImageViewResource and I can't seem to get .setAlpha to work
with this command.

Is there a way to get this to work or am I going to have to double my
application size by including doubles of my resources?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Trouble with bluetooth pairing my Samsung Galaxy Tablet with my PC

2011-02-22 Thread Jeffrey
I'm not sure if this is the case but usually BluTooth default PINs are
. Might be worth a try.

On Feb 22, 9:33 am, OldSkoolMark m...@sublimeslime.com wrote:
 I am attempting to pair my Galaxy Tab with my Toshiba win 7 x64
 laptop. The pairing fails because the laptop needs a PIN. I never set
 a PIN, nor to my knowledge was I  provided with one when I got the
 device from Verizon. Also, the dialog that appears doesn't provide any
 place to enter one.

 Anybody succeed in connecting their Galaxy Tab to their PC? How do I
 discover and set this mysterious bluetooth PIN?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Setting Alpha for an imageView in a homescreen widget

2011-02-22 Thread Jeffrey
Yeah, looking at things again I think that will work. I wasn't looking
at the correct way of converting to bitmap but I found the way that
will let it work.

Thanks!

On Feb 22, 3:50 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 22 February 2011 22:39, Jeffrey jeffisagen...@gmail.com wrote:

  Is there a way to get this to work or am I going to have to double my
  application size by including doubles of my resources?

 What about preparing bitmap based on your drawable and then use
 setImageViewBitmap()

 --
 Regards,
 Marcin

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Setting Alpha for an imageView in a homescreen widget

2011-02-22 Thread Jeffrey
Okay, after trying it out I am still facing issues. I can't seem to
get the alpha to carry over after converting to Bitmap and using
setImageViewBitmap(). This is my code so far:

Drawable Sec1 = this.getResources().getDrawable(Test[180]);
Sec1.mutate().setAlpha(80);
Bitmap Section1 = ((BitmapDrawable)Sec1).getBitmap();
views.setImageViewBitmap(R.id.IVGhost1, Section1);

With this I get no alpha, and if I try this:

Bitmap Section1 = ((BitmapDrawable)Sec1).getBitmap().extractAlpha();
(Adding the extractAlpha() command)

then I get an all black image. What am I missing?

On Feb 22, 3:39 pm, Jeffrey jeffisagen...@gmail.com wrote:
 I have traversed the internet and have yet to find an answer for this
 problem. I have a set of image resources that I use in my widget, I
 need to be able to reuse them but with differing Alpha levels. So far
 the only command I can find to change alpha levels is .setAlpha(), but
 that will not work as I am having to dispatch the image
 via .setImageViewResource and I can't seem to get .setAlpha to work
 with this command.

 Is there a way to get this to work or am I going to have to double my
 application size by including doubles of my resources?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Setting Alpha for an imageView in a homescreen widget

2011-02-22 Thread Jeffrey
Another option that might be easier is if I could find a way to set an
alpha for the ImageViews themselves, but I can't find an easy way to
do that.

On Feb 22, 4:42 pm, Jeffrey jeffisagen...@gmail.com wrote:
 Okay, after trying it out I am still facing issues. I can't seem to
 get the alpha to carry over after converting to Bitmap and using
 setImageViewBitmap(). This is my code so far:

 Drawable Sec1 = this.getResources().getDrawable(Test[180]);
 Sec1.mutate().setAlpha(80);
 Bitmap Section1 = ((BitmapDrawable)Sec1).getBitmap();
 views.setImageViewBitmap(R.id.IVGhost1, Section1);

 With this I get no alpha, and if I try this:

 Bitmap Section1 = ((BitmapDrawable)Sec1).getBitmap().extractAlpha();
 (Adding the extractAlpha() command)

 then I get an all black image. What am I missing?

 On Feb 22, 3:39 pm, Jeffrey jeffisagen...@gmail.com wrote:







  I have traversed the internet and have yet to find an answer for this
  problem. I have a set of image resources that I use in my widget, I
  need to be able to reuse them but with differing Alpha levels. So far
  the only command I can find to change alpha levels is .setAlpha(), but
  that will not work as I am having to dispatch the image
  via .setImageViewResource and I can't seem to get .setAlpha to work
  with this command.

  Is there a way to get this to work or am I going to have to double my
  application size by including doubles of my resources?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Setting Alpha for an imageView in a homescreen widget

2011-02-22 Thread Jeffrey
That totally works! Thank you, you are a life saver.

On Feb 22, 5:24 pm, YuviDroid yuvidr...@gmail.com wrote:
 Since Android 2.2 the method setAlpha() of ImageViews has become
 @RemoteViewable (or something like that, I don't remember that annotation).
 So you can simply call RemoteViews.setInt (viewId, setAlpha, value).

 I haven't tried it myself, but I believe it should work..









 On Tue, Feb 22, 2011 at 11:50 PM, Jeffrey jeffisagen...@gmail.com wrote:
  Another option that might be easier is if I could find a way to set an
  alpha for the ImageViews themselves, but I can't find an easy way to
  do that.

  On Feb 22, 4:42 pm, Jeffrey jeffisagen...@gmail.com wrote:
   Okay, after trying it out I am still facing issues. I can't seem to
   get the alpha to carry over after converting to Bitmap and using
   setImageViewBitmap(). This is my code so far:

   Drawable Sec1 = this.getResources().getDrawable(Test[180]);
   Sec1.mutate().setAlpha(80);
   Bitmap Section1 = ((BitmapDrawable)Sec1).getBitmap();
   views.setImageViewBitmap(R.id.IVGhost1, Section1);

   With this I get no alpha, and if I try this:

   Bitmap Section1 = ((BitmapDrawable)Sec1).getBitmap().extractAlpha();
   (Adding the extractAlpha() command)

   then I get an all black image. What am I missing?

   On Feb 22, 3:39 pm, Jeffrey jeffisagen...@gmail.com wrote:

I have traversed the internet and have yet to find an answer for this
problem. I have a set of image resources that I use in my widget, I
need to be able to reuse them but with differing Alpha levels. So far
the only command I can find to change alpha levels is .setAlpha(), but
that will not work as I am having to dispatch the image
via .setImageViewResource and I can't seem to get .setAlpha to work
with this command.

Is there a way to get this to work or am I going to have to double my
application size by including doubles of my resources?

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

2011-02-10 Thread Jeffrey
Okay, so here's the problem that is making me want to pull my hair
out.

I'm trying to implement the LVL, and when following the instructions
everything goes just fine until I hit the step of setting the LVL as a
library in my apps properties. When I add it, it does just what the
example pictures show, under project it lists
com_android_vending_licensing and shows the green check mark but
when I hit apply and okay, and then go back in to properties it shows
the project as ? and has a big red X.

This is infuriating as I have followed the instructions to a tee and
it isn't working.



I am getting sick of google giving tutorials that are missing code to
make them work.

What am I doing wrong?

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


[android-developers] Re: Where to put a broadcast receiver for a widget

2011-02-03 Thread Jeffrey
Wow, thank you! Now I guess I need to look up a tutorial on using the
AlarmManager.

On Feb 3, 7:46 am, Mark Murphy mmur...@commonsware.com wrote:
 On Wed, Feb 2, 2011 at 9:57 PM, Jeffrey jeffisagen...@gmail.com wrote:
  I've got a battery widget I'm working on and I have a broadcast
  receiver for when the battery status changes, but I don't know where
  it needs to go. I tried putting it in the Configuration activity, but
  I keep getting this error:

  Activity com.android.blah has leaked IntentReceiver com.android.blah
  $2@43758c58 that was originally registered here. Are you missing a
  call to unregisterReceiver()?

  Please let me know what I'm doing wrong, I'm pretty new to broadcast
  receivers, so if I'm missing something basic please let me know.

 I wouldn't use a broadcast receiver in this case. That would require
 you to keep a service running 24x7, to host the receiver, and that is
 bad for business.

 Rather, just check the battery level periodically:

  - via updatePeriodMillis in your metadata, or
  - via AlarmManager, if the 30-minute minimum for updatePeriodMillis
 will be too long (probably would be, in this case)

 To check the battery level, call registerReceiver() with the
 ACTION_BATTERY_CHANGED IntentFilter, but a null BroadcastReceiver. The
 Intent that is returned to you will be the last-broadcast battery
 change Intent, from which you can get the last-known battery level.

 You can even let the user configure the polling period, to balance
 between accuracy and battery consumption by the battery app widget.

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

 Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2

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

2011-02-03 Thread Jeffrey
One question on AlarmManager, the examples I'm seeing all say to set
up a broadcast receiver, but wouldn't that defeat the purpose using
alarmmanager to prevent running a BroadcastReceiver in a service? Or
is the AppWidgetProvider class able to receive the broadcast?

On Feb 3, 4:21 pm, Jeffrey jeffisagen...@gmail.com wrote:
 Wow, thank you! Now I guess I need to look up a tutorial on using the
 AlarmManager.

 On Feb 3, 7:46 am, Mark Murphy mmur...@commonsware.com wrote:







  On Wed, Feb 2, 2011 at 9:57 PM, Jeffrey jeffisagen...@gmail.com wrote:
   I've got a battery widget I'm working on and I have a broadcast
   receiver for when the battery status changes, but I don't know where
   it needs to go. I tried putting it in the Configuration activity, but
   I keep getting this error:

   Activity com.android.blah has leaked IntentReceiver com.android.blah
   $2@43758c58 that was originally registered here. Are you missing a
   call to unregisterReceiver()?

   Please let me know what I'm doing wrong, I'm pretty new to broadcast
   receivers, so if I'm missing something basic please let me know.

  I wouldn't use a broadcast receiver in this case. That would require
  you to keep a service running 24x7, to host the receiver, and that is
  bad for business.

  Rather, just check the battery level periodically:

   - via updatePeriodMillis in your metadata, or
   - via AlarmManager, if the 30-minute minimum for updatePeriodMillis
  will be too long (probably would be, in this case)

  To check the battery level, call registerReceiver() with the
  ACTION_BATTERY_CHANGED IntentFilter, but a null BroadcastReceiver. The
  Intent that is returned to you will be the last-broadcast battery
  change Intent, from which you can get the last-known battery level.

  You can even let the user configure the polling period, to balance
  between accuracy and battery consumption by the battery app widget.

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

  Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2

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

2011-02-03 Thread Jeffrey
Thank you, one last issue that I'm having, you said to get the battery
level to call registerReceiver with a null broadcast receiver, but
when I try the following code I get a nullpointerexception:

int rawlevel = registerReceiver(null,
batteryLevelFilter).getIntExtra(level, -1);

I'm not sure if thats right or not. When I was running a broadcast
receiver it grabbed the context and the code was as such:

 int rawlevel = intent.getIntExtra(level, -1);

which worked but since I no longer use the broadcast receiver to grab
the intent I can't seem to figure out how to get it into a manageable
variable.

On Feb 3, 5:21 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 AppWidgetProvider *is* a broadcast receiver, so you can handle your alarm
 actions right there.

 Some broadcasts can't be received by declaring intent filters in the
 manifest, I believe battery state is one of those.

 No such limitation with your own alarm action, though, so there isn't a
 chicken and egg (= service and receiver) issue here, as for the battery
 broadcast.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com
 04.02.2011 1:57 пользователь Jeffrey jeffisagen...@gmail.com написал:







  One question on AlarmManager, the examples I'm seeing all say to set
  up a broadcast receiver, but wouldn't that defeat the purpose using
  alarmmanager to prevent running a BroadcastReceiver in a service? Or
  is the AppWidgetProvider class able to receive the broadcast?

  On Feb 3, 4:21 pm, Jeffrey jeffisagen...@gmail.com wrote:
  Wow, thank you! Now I guess I need to look up a tutorial on using the
  AlarmManager.

  On Feb 3, 7:46 am, Mark Murphy mmur...@commonsware.com wrote:

   On Wed, Feb 2, 2011 at 9:57 PM, Jeffrey jeffisagen...@gmail.com
 wrote:
I've got a battery widget I'm working on and I have a broadcast
receiver for when the battery status changes, but I don't know where
it needs to go. I tried putting it in the Configuration activity, but
I keep getting this error:

Activity com.android.blah has leaked IntentReceiver com.android.blah
$2@43758c58 that was originally registered here. Are you missing a
call to unregisterReceiver()?

Please let me know what I'm doing wrong, I'm pretty new to broadcast
receivers, so if I'm missing something basic please let me know.

   I wouldn't use a broadcast receiver in this case. That would require
   you to keep a service running 24x7, to host the receiver, and that is
   bad for business.

   Rather, just check the battery level periodically:

    - via updatePeriodMillis in your metadata, or
    - via AlarmManager, if the 30-minute minimum for updatePeriodMillis
   will be too long (probably would be, in this case)

   To check the battery level, call registerReceiver() with the
   ACTION_BATTERY_CHANGED IntentFilter, but a null BroadcastReceiver. The
   Intent that is returned to you will be the last-broadcast battery
   change Intent, from which you can get the last-known battery level.

   You can even let the user configure the polling period, to balance
   between accuracy and battery consumption by the battery app widget.

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

 http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy









   Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2

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

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


[android-developers] Re: Where to put a broadcast receiver for a widget

2011-02-03 Thread Jeffrey
Am I doing something wrong? The first time my app runs this code it
runs it from the Configuration page and it works just fine, the second
time it comes up with a nullpointerexception, the code is this:

IntentFilter batteryLevelFilter = new
IntentFilter(Intent.ACTION_BATTERY_CHANGED);
rawlevel = registerReceiver(null,
batteryLevelFilter).getIntExtra(level, -1);

I know that registerReceiver doesn't like to run from the
AppWidgetProvider, so is it something to do with the class being
called by the onUpdate()? I don't know if I need to do anything
special but I can't seem to get it to run this line of code to save my
life.

Also as a side note I tried using this

int rawlevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);

and it can't resolve BatteryManager.EXTRA_LEVEL even after importing
BatteryManager and setting the minSDK to 8.

On Feb 3, 8:30 pm, AndroidDevTime androiddevd...@gmail.com wrote:
 what are the power battery performance implications of maintaining a
 service? Will this drain the battery more to keep a service up and
 running?  Especially if you bind to the service from the widget to
 call service functions?

 On Feb 3, 3:39 pm, Mark Murphy mmur...@commonsware.com wrote:







  2011/2/3 Jeffrey jeffisagen...@gmail.com:

   Thank you, one last issue that I'm having, you said to get the battery
   level to call registerReceiver with a null broadcast receiver, but
   when I try the following code I get a nullpointerexception:

   int rawlevel = registerReceiver(null,
   batteryLevelFilter).getIntExtra(level, -1);

   I'm not sure if thats right or not. When I was running a broadcast
   receiver it grabbed the context and the code was as such:

    int rawlevel = intent.getIntExtra(level, -1);

   which worked but since I no longer use the broadcast receiver to grab
   the intent I can't seem to figure out how to get it into a manageable
   variable.

  There are two possibilities:

  1. Your batteryLevelFilter is incorrect

  2. Your code is being called before an ACTION_BATTERY_CHANGED
  broadcast has been sent

  Since #2 is conceivable, depending on when you are setting up your
  alarms, be sure to handle a null response to registerReceiver().

  Also, I would use BatteryManager.EXTRA_LEVEL instead of level.
  That's a change I need to make in one of my own examples, one of these
  days...

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

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

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


[android-developers] Re: Where to put a broadcast receiver for a widget

2011-02-03 Thread Jeffrey
Also the only thing that changes is the Context, is that where the
problem is? Because if it's not that then I have absolutely no clue as
to what it could be.

On Feb 3, 10:45 pm, Jeffrey jeffisagen...@gmail.com wrote:
 Am I doing something wrong? The first time my app runs this code it
 runs it from the Configuration page and it works just fine, the second
 time it comes up with a nullpointerexception, the code is this:

 IntentFilter batteryLevelFilter = new
 IntentFilter(Intent.ACTION_BATTERY_CHANGED);
 rawlevel = registerReceiver(null,
 batteryLevelFilter).getIntExtra(level, -1);

 I know that registerReceiver doesn't like to run from the
 AppWidgetProvider, so is it something to do with the class being
 called by the onUpdate()? I don't know if I need to do anything
 special but I can't seem to get it to run this line of code to save my
 life.

 Also as a side note I tried using this

 int rawlevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);

 and it can't resolve BatteryManager.EXTRA_LEVEL even after importing
 BatteryManager and setting the minSDK to 8.

 On Feb 3, 8:30 pm, AndroidDevTime androiddevd...@gmail.com wrote:







  what are the power battery performance implications of maintaining a
  service? Will this drain the battery more to keep a service up and
  running?  Especially if you bind to the service from the widget to
  call service functions?

  On Feb 3, 3:39 pm, Mark Murphy mmur...@commonsware.com wrote:

   2011/2/3 Jeffrey jeffisagen...@gmail.com:

Thank you, one last issue that I'm having, you said to get the battery
level to call registerReceiver with a null broadcast receiver, but
when I try the following code I get a nullpointerexception:

int rawlevel = registerReceiver(null,
batteryLevelFilter).getIntExtra(level, -1);

I'm not sure if thats right or not. When I was running a broadcast
receiver it grabbed the context and the code was as such:

 int rawlevel = intent.getIntExtra(level, -1);

which worked but since I no longer use the broadcast receiver to grab
the intent I can't seem to figure out how to get it into a manageable
variable.

   There are two possibilities:

   1. Your batteryLevelFilter is incorrect

   2. Your code is being called before an ACTION_BATTERY_CHANGED
   broadcast has been sent

   Since #2 is conceivable, depending on when you are setting up your
   alarms, be sure to handle a null response to registerReceiver().

   Also, I would use BatteryManager.EXTRA_LEVEL instead of level.
   That's a change I need to make in one of my own examples, one of these
   days...

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

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

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


[android-developers] Re: Where to put a broadcast receiver for a widget

2011-02-03 Thread Jeffrey
Okay, figured it out. I guess I can't have anything from the
AppWidgetProvider class activate a registerReceiver so I have to make
a service to do it. I don't keep it running, just launch it to update
everything then it dies.

Thanks for your help and patience.

On Feb 3, 10:56 pm, Jeffrey jeffisagen...@gmail.com wrote:
 Also the only thing that changes is the Context, is that where the
 problem is? Because if it's not that then I have absolutely no clue as
 to what it could be.

 On Feb 3, 10:45 pm, Jeffrey jeffisagen...@gmail.com wrote:







  Am I doing something wrong? The first time my app runs this code it
  runs it from the Configuration page and it works just fine, the second
  time it comes up with a nullpointerexception, the code is this:

  IntentFilter batteryLevelFilter = new
  IntentFilter(Intent.ACTION_BATTERY_CHANGED);
  rawlevel = registerReceiver(null,
  batteryLevelFilter).getIntExtra(level, -1);

  I know that registerReceiver doesn't like to run from the
  AppWidgetProvider, so is it something to do with the class being
  called by the onUpdate()? I don't know if I need to do anything
  special but I can't seem to get it to run this line of code to save my
  life.

  Also as a side note I tried using this

  int rawlevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1);

  and it can't resolve BatteryManager.EXTRA_LEVEL even after importing
  BatteryManager and setting the minSDK to 8.

  On Feb 3, 8:30 pm, AndroidDevTime androiddevd...@gmail.com wrote:

   what are the power battery performance implications of maintaining a
   service? Will this drain the battery more to keep a service up and
   running?  Especially if you bind to the service from the widget to
   call service functions?

   On Feb 3, 3:39 pm, Mark Murphy mmur...@commonsware.com wrote:

2011/2/3 Jeffrey jeffisagen...@gmail.com:

 Thank you, one last issue that I'm having, you said to get the battery
 level to call registerReceiver with a null broadcast receiver, but
 when I try the following code I get a nullpointerexception:

 int rawlevel = registerReceiver(null,
 batteryLevelFilter).getIntExtra(level, -1);

 I'm not sure if thats right or not. When I was running a broadcast
 receiver it grabbed the context and the code was as such:

  int rawlevel = intent.getIntExtra(level, -1);

 which worked but since I no longer use the broadcast receiver to grab
 the intent I can't seem to figure out how to get it into a manageable
 variable.

There are two possibilities:

1. Your batteryLevelFilter is incorrect

2. Your code is being called before an ACTION_BATTERY_CHANGED
broadcast has been sent

Since #2 is conceivable, depending on when you are setting up your
alarms, be sure to handle a null response to registerReceiver().

Also, I would use BatteryManager.EXTRA_LEVEL instead of level.
That's a change I need to make in one of my own examples, one of these
days...

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

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

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


[android-developers] Where to put a broadcast receiver for a widget

2011-02-02 Thread Jeffrey
I've got a battery widget I'm working on and I have a broadcast
receiver for when the battery status changes, but I don't know where
it needs to go. I tried putting it in the Configuration activity, but
I keep getting this error:

Activity com.android.blah has leaked IntentReceiver com.android.blah
$2@43758c58 that was originally registered here. Are you missing a
call to unregisterReceiver()?


Please let me know what I'm doing wrong, I'm pretty new to broadcast
receivers, so if I'm missing something basic please let me know.

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


[android-developers] Update Droid for testing

2010-10-06 Thread Jeffrey
This may seem like a dumb question but I am new to programming on the
Droid and I am using a Droid at version 1.1. How do I update it to a
more recent version? Preferable at least 1.6.

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

2010-08-28 Thread Jeffrey
This almost works, but when I click on a point that has a smaller X
value than it's current position it reverses the Y Direction.

On Aug 27, 1:01 pm, Robert Green rbgrn@gmail.com wrote:
 Direction will be in the range -180 to 180 so don't use abs!  Always
 use sin/cos for y/x respectively when in y+ down 2D coordinate
 systems, otherwise x/y respectively.

 Here is kind of what you want

 // tickDelta should be something like .016f to .033f - definitely
 should total 1.0f per second :)
 float tickDelta = (currentMs - lastMs) / 1000f;
 // now mMoveSpeed can be expressed in units-per-second and it'll work
 at any framerate if you multiply by tickdelta

 float touchDelta = (float)(TouchY - V.CurY) / (TouchX - V.CurX);
 float dirRads = (float)Math.atan(touchDelta);
 float amountX = (float)Math.cos(dirRads) * mMoveSpeed * tickDelta;
 float amountY = (float)Math.sin(dirRads) * mMoveSpeed * tickDelta;
 x += amountX;
 y += amountY;

 // no additional checks needed.  This is how you do 2D directional
 movement.
 // this assumes that either TouchX/TouchY or V is set only when the
 touch is touched down initially so that a vector is made when the
 touch moves and that value is not updated.

 On Aug 26, 8:40 pm, Jeffrey jeffisagen...@gmail.com wrote:



  I know this is more of a general programming question, but my Android
  friends here have always been helpful. I am trying to make an image
  move from one part of the screen to a position the user touches, as a
  constant speed. I don't know the best way to go about doing this and
  the way I have been trying to get to work is taxing my brain too much.

  I have been using geometry to calculate slope, then using Sin *
  movement speed to calculate the difference in X,Y coordinates.

  This is the code I'm looking at:

                          TouchX = V.TX; (This is the touch event coordinates
                          TouchY =
  V.TY;                                                      )

                          Slope = (TouchY - V.CurY) / (TouchX - V.CurX);  
  (this figures out
  the slope of the line to the touch point)
                          DegreeSlopeY = Math.atan(Slope);
                          DegreeSlopeY = Math.abs(DegreeSlopeY);
                                                          (this is so
  that I can calculate the direction the image should travel along the
  slope)
                          DegreeSlopeX = (90.0 - DegreeSlopeY);
                          NewY = (mMoveSpeed * Math.sin(DegreeSlopeY)); (This 
  calculates the
  shift in Y axis for the image)
                          NewX = (mMoveSpeed * Math.sin(DegreeSlopeX));  
  (This calculates the
  shift in X axis for the image)
                          if(TouchX  V.CenterX) NewX = -NewX;    (This is to 
  finish
  calculating the correct X axis direction to travel)
                          if(TouchY  V.CenterY) NewY = -NewY;   (This is to 
  finish
  calculating the correct X axis direction to travel)

  The problem that I'm having is the image is veering way of course when
  traveling in Y heavy paths. When traveling horizontally it works
  almost perfect.

  I know there is probably an easier way though I don't know how to use
  a lot of things (like OpenGLES) so if your advice is to use a
  different method please link a tutorial for that method if you know of
  one.

  Thanks in advance.

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


[android-developers] Re: Game math/logic calulating movement

2010-08-28 Thread Jeffrey
The problem is that it is only moving the image one direction along
the slope of the line. I've tried making a condition that checks to
see if the target area is to the left of the current position, and if
so then make the X/Y differences negative, but that works very
sporadically, and make the image move in crazy ways sometime.

On Aug 28, 5:33 pm, Jeffrey jeffisagen...@gmail.com wrote:
 This almost works, but when I click on a point that has a smaller X
 value than it's current position it reverses the Y Direction.

 On Aug 27, 1:01 pm, Robert Green rbgrn@gmail.com wrote:



  Direction will be in the range -180 to 180 so don't use abs!  Always
  use sin/cos for y/x respectively when in y+ down 2D coordinate
  systems, otherwise x/y respectively.

  Here is kind of what you want

  // tickDelta should be something like .016f to .033f - definitely
  should total 1.0f per second :)
  float tickDelta = (currentMs - lastMs) / 1000f;
  // now mMoveSpeed can be expressed in units-per-second and it'll work
  at any framerate if you multiply by tickdelta

  float touchDelta = (float)(TouchY - V.CurY) / (TouchX - V.CurX);
  float dirRads = (float)Math.atan(touchDelta);
  float amountX = (float)Math.cos(dirRads) * mMoveSpeed * tickDelta;
  float amountY = (float)Math.sin(dirRads) * mMoveSpeed * tickDelta;
  x += amountX;
  y += amountY;

  // no additional checks needed.  This is how you do 2D directional
  movement.
  // this assumes that either TouchX/TouchY or V is set only when the
  touch is touched down initially so that a vector is made when the
  touch moves and that value is not updated.

  On Aug 26, 8:40 pm, Jeffrey jeffisagen...@gmail.com wrote:

   I know this is more of a general programming question, but my Android
   friends here have always been helpful. I am trying to make an image
   move from one part of the screen to a position the user touches, as a
   constant speed. I don't know the best way to go about doing this and
   the way I have been trying to get to work is taxing my brain too much.

   I have been using geometry to calculate slope, then using Sin *
   movement speed to calculate the difference in X,Y coordinates.

   This is the code I'm looking at:

                           TouchX = V.TX; (This is the touch event 
   coordinates
                           TouchY =
   V.TY;                                                      )

                           Slope = (TouchY - V.CurY) / (TouchX - V.CurX);  
   (this figures out
   the slope of the line to the touch point)
                           DegreeSlopeY = Math.atan(Slope);
                           DegreeSlopeY = Math.abs(DegreeSlopeY);
                                                           (this is so
   that I can calculate the direction the image should travel along the
   slope)
                           DegreeSlopeX = (90.0 - DegreeSlopeY);
                           NewY = (mMoveSpeed * Math.sin(DegreeSlopeY)); 
   (This calculates the
   shift in Y axis for the image)
                           NewX = (mMoveSpeed * Math.sin(DegreeSlopeX));  
   (This calculates the
   shift in X axis for the image)
                           if(TouchX  V.CenterX) NewX = -NewX;    (This is 
   to finish
   calculating the correct X axis direction to travel)
                           if(TouchY  V.CenterY) NewY = -NewY;   (This is 
   to finish
   calculating the correct X axis direction to travel)

   The problem that I'm having is the image is veering way of course when
   traveling in Y heavy paths. When traveling horizontally it works
   almost perfect.

   I know there is probably an easier way though I don't know how to use
   a lot of things (like OpenGLES) so if your advice is to use a
   different method please link a tutorial for that method if you know of
   one.

   Thanks in advance.

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


[android-developers] Re: Game math/logic calulating movement

2010-08-28 Thread Jeffrey
Okay, figured it out. I had some remnants from an old system still in
there and was referencing a variable that wasn't being updated
correctly.

Thank you for you help :)

On Aug 28, 5:47 pm, Jeffrey jeffisagen...@gmail.com wrote:
 The problem is that it is only moving the image one direction along
 the slope of the line. I've tried making a condition that checks to
 see if the target area is to the left of the current position, and if
 so then make the X/Y differences negative, but that works very
 sporadically, and make the image move in crazy ways sometime.

 On Aug 28, 5:33 pm, Jeffrey jeffisagen...@gmail.com wrote:



  This almost works, but when I click on a point that has a smaller X
  value than it's current position it reverses the Y Direction.

  On Aug 27, 1:01 pm, Robert Green rbgrn@gmail.com wrote:

   Direction will be in the range -180 to 180 so don't use abs!  Always
   use sin/cos for y/x respectively when in y+ down 2D coordinate
   systems, otherwise x/y respectively.

   Here is kind of what you want

   // tickDelta should be something like .016f to .033f - definitely
   should total 1.0f per second :)
   float tickDelta = (currentMs - lastMs) / 1000f;
   // now mMoveSpeed can be expressed in units-per-second and it'll work
   at any framerate if you multiply by tickdelta

   float touchDelta = (float)(TouchY - V.CurY) / (TouchX - V.CurX);
   float dirRads = (float)Math.atan(touchDelta);
   float amountX = (float)Math.cos(dirRads) * mMoveSpeed * tickDelta;
   float amountY = (float)Math.sin(dirRads) * mMoveSpeed * tickDelta;
   x += amountX;
   y += amountY;

   // no additional checks needed.  This is how you do 2D directional
   movement.
   // this assumes that either TouchX/TouchY or V is set only when the
   touch is touched down initially so that a vector is made when the
   touch moves and that value is not updated.

   On Aug 26, 8:40 pm, Jeffrey jeffisagen...@gmail.com wrote:

I know this is more of a general programming question, but my Android
friends here have always been helpful. I am trying to make an image
move from one part of the screen to a position the user touches, as a
constant speed. I don't know the best way to go about doing this and
the way I have been trying to get to work is taxing my brain too much.

I have been using geometry to calculate slope, then using Sin *
movement speed to calculate the difference in X,Y coordinates.

This is the code I'm looking at:

                        TouchX = V.TX; (This is the touch event 
coordinates
                        TouchY =
V.TY;                                                      )

                        Slope = (TouchY - V.CurY) / (TouchX - V.CurX);  
(this figures out
the slope of the line to the touch point)
                        DegreeSlopeY = Math.atan(Slope);
                        DegreeSlopeY = Math.abs(DegreeSlopeY);
                                                        (this is so
that I can calculate the direction the image should travel along the
slope)
                        DegreeSlopeX = (90.0 - 
DegreeSlopeY);
                        NewY = (mMoveSpeed * Math.sin(DegreeSlopeY)); 
(This calculates the
shift in Y axis for the image)
                        NewX = (mMoveSpeed * Math.sin(DegreeSlopeX));  
(This calculates the
shift in X axis for the image)
                        if(TouchX  V.CenterX) NewX = -NewX;    (This 
is to finish
calculating the correct X axis direction to travel)
                        if(TouchY  V.CenterY) NewY = -NewY;   (This is 
to finish
calculating the correct X axis direction to travel)

The problem that I'm having is the image is veering way of course when
traveling in Y heavy paths. When traveling horizontally it works
almost perfect.

I know there is probably an easier way though I don't know how to use
a lot of things (like OpenGLES) so if your advice is to use a
different method please link a tutorial for that method if you know of
one.

Thanks in advance.

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


[android-developers] Game math/logic calulating movement

2010-08-26 Thread Jeffrey
I know this is more of a general programming question, but my Android
friends here have always been helpful. I am trying to make an image
move from one part of the screen to a position the user touches, as a
constant speed. I don't know the best way to go about doing this and
the way I have been trying to get to work is taxing my brain too much.

I have been using geometry to calculate slope, then using Sin *
movement speed to calculate the difference in X,Y coordinates.

This is the code I'm looking at:

TouchX = V.TX; (This is the touch event coordinates
TouchY =
V.TY;  )

Slope = (TouchY - V.CurY) / (TouchX - V.CurX);  (this 
figures out
the slope of the line to the touch point)
DegreeSlopeY = Math.atan(Slope);
DegreeSlopeY = Math.abs(DegreeSlopeY);
(this is so
that I can calculate the direction the image should travel along the
slope)
DegreeSlopeX = (90.0 - DegreeSlopeY);
NewY = (mMoveSpeed * Math.sin(DegreeSlopeY)); (This 
calculates the
shift in Y axis for the image)
NewX = (mMoveSpeed * Math.sin(DegreeSlopeX));  (This 
calculates the
shift in X axis for the image)
if(TouchX  V.CenterX) NewX = -NewX;(This is to 
finish
calculating the correct X axis direction to travel)
if(TouchY  V.CenterY) NewY = -NewY;   (This is to 
finish
calculating the correct X axis direction to travel)



The problem that I'm having is the image is veering way of course when
traveling in Y heavy paths. When traveling horizontally it works
almost perfect.

I know there is probably an easier way though I don't know how to use
a lot of things (like OpenGLES) so if your advice is to use a
different method please link a tutorial for that method if you know of
one.

Thanks in advance.

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


[android-developers] Re: why application size increase in market

2010-08-01 Thread Jeffrey
Do you have copy protection on? Turning on copy protection increases
the file size. A way to get around that is to create your app with the
new licensing feature.

On Aug 1, 11:17 pm, aswani kumar tholeti ensisinf...@gmail.com
wrote:
 Hi Folks,

 i developed one application its apk file size is 1.x mb.i uploaded apps into
 android market

 when i check application on market it's  size 2.x.why my application size is
 increase on android market.

 is there any possibility to reduce the size of apps on android market.

 Thanks in Advance

 Aswan

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

2010-08-01 Thread Jeffrey
The only thing I can say is that it is going to be used primarily on
paid apps. Paid apps that you would have had to buy through the
market. Meaning that using them on non-market devices wouldn't be
possible anyway, since the apps that will be using it are probably
using the current form of copy protection which prevents you from
using it on non-market devices seeing as you can't copy them.

This is a completely different situation from music DRM. When you play
DRM music you don't have it checking a server to see if you purchased
it, they usually just make it retardedly restrictive to copy/move to a
new device.

On Aug 1, 9:02 pm, ocdtrekkie jtn...@gmail.com wrote:
 Someone did point out to me that LVL should not affect people on non-
 Market devices, which helps a bit, if its true (I haven't confirmed
 it), so that's a bit better, but I'm still very concerned about the
 damage some of the messes licensing concerns may cause, when right
 now, half the time downloading paid apps doesn't work right now as
 is.  Additional mess, sigh.

 On Aug 1, 8:53 pm, ocdtrekkie jtn...@gmail.com wrote:



  Is nobody else worried about the rampant stupidity of DRM now being
  applied to Android?

  The music industry spend many years and billions of dollars before
  realizing DRM did not stop pirates, and merely harassed and annoyed
  paying customers.  I for one, will not purchase any paid app that
  utilizes LVL protection, because I want the ability to use my apps on
  non-Market devices for example.

  It seems that every developer is gung ho about this, which is why I
  want to ask you guys, the developers, more about your opinions on
  this.

  DRM has been proven time and time again to do nothing to stop piracy,
  I have a membership in a tracker I use for replacing some of my
  damaged retail discs, and I see cracked copies of games coming through
  the same day of release, for major PC titles with massive DRM suites.
  The only thing it does, is inconvenience legitimate users who want to
  utilize their apps the way they want to.

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


[android-developers] LVL Sample application problems

2010-08-01 Thread Jeffrey
I've followed the instructions for loading the sample LVL application
and it loads up with a bunch of errors. Anywhere that a
R.layout.main or R.* request is made it says R cannot be resolved.
It suggests importing Android.R but if I do that then it says it can't
find any of the files, including the R.layout.main file which is
definitely there.

What gives? I have had several problems with sample applications so
far, am I doing something wrong? You'd think that all you have to do
is import it from existing source and it should work.

Has anyone else had this issue?

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


[android-developers] Dynamically creating list on button click

2010-07-28 Thread jeffrey neville
I am trying to make a class schedule that looks something like this
__
TextView TextView  TextView












[_EditText_]

[addClass Button][addTime Button][addBuilding Button]
___

I have the layout and the buttons adding text  from the edit text
field when clicked.
However I need to add a new text view when the button is click.  I
believe that I should be using some type of array to accomplish this
but I am not sure exactly how.  Also, the text is not being saved when
the program exits.

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

2010-07-16 Thread Jeffrey
I disagree, my paid app now has less downloads then I have purchases.
So something is definitely up...

On Jul 16, 4:06 pm, Maps.Huge.Info (Maps API Guru)
cor...@gmail.com wrote:
 Our app Radar Now! dropped from 611,000 to 562,000 - quite a bit!
 However, when compared to our own internal counts, they are much more
 in line now. We count each individual registration of an Android ID as
 one install, which should be the way Google does it. The discrepancy
 is on the order of 20,000 between our numbers and the market, so that
 makes a lot more sense. The differences most likely are those that
 downloaded the app but have never run it. 20,000 out of nearly 600,000
 is only 3%, I can accept that.

 -John Coryat

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


[android-developers] HDPI images looking like crap

2010-07-03 Thread Jeffrey
How do I get my HDPI images to not look like autoscaled versions? Do I
need to make the pixels per inch special or something? I use GIMP and
I've tried everything and my images still look terrible. I don't know
what property I have to change to make it work.

Right now I have my ppi set at 72. Also I don't know if this matters
but the images are 9patch images. Also, I am using the HDPI button
image straight from the HDPI source folder, and it also looks like
crap when using .setBackgroundResource(R.drawable.imagename).

The weird part about the button image is that it looks just fine when
it's set via XML as the background resource, but when it's reset
using .setBackgroundResource, it looks like shit. Please tell me what
I am doing wrong...

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


[android-developers] Re: HDPI images looking like crap

2010-07-03 Thread Jeffrey
Nevermind, I have found the solution.

I changed uses-sdk android:minSdkVersion=3/ to uses-sdk
android:targetSdkVersion=6/ and added

supports-screens
  android:largeScreens=true
  android:normalScreens=true
**android:resizeable=true**
  android:smallScreens=true
  android:anyDensity=true /

On Jul 3, 8:39 pm, Jeffrey jeffisagen...@gmail.com wrote:
 How do I get my HDPI images to not look like autoscaled versions? Do I
 need to make the pixels per inch special or something? I use GIMP and
 I've tried everything and my images still look terrible. I don't know
 what property I have to change to make it work.

 Right now I have my ppi set at 72. Also I don't know if this matters
 but the images are 9patch images. Also, I am using the HDPI button
 image straight from the HDPI source folder, and it also looks like
 crap when using .setBackgroundResource(R.drawable.imagename).

 The weird part about the button image is that it looks just fine when
 it's set via XML as the background resource, but when it's reset
 using .setBackgroundResource, it looks like shit. Please tell me what
 I am doing wrong...

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


[android-developers] logcat buffer size

2010-06-16 Thread Jeffrey Blattman
i want to increase the logcat buffer size. that is, when i do logcat from
adb or from a shell, i want to see more historical log entries.

i see that logcat has a -r size option, but that requires -f
filename also. i don't understand what this means. i want to change the
size of the default buffer, why is it asking me for a file name? my
understanding is that logcat is just a wrapper around /dev/log/*?

i realize i might have a fundamental misunderstanding about what -r
actually does. for example, it sounds like it may cause the system to create
a file-based rotated log, in addition to the /dev/log/* devices? that's not
really what i want.

? thanks.

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

[android-developers] Re: How to detect Bluetooth headset key press

2010-05-24 Thread Jeffrey Palm
You can override the onKeyDown method in any activity and check for
the KeyEvent.KEYCODE_MEDIA_* key codes.  e.g.

boolean onKeyDown(int keyCode, KeyEvent event) {
AudibleReadyPlayer p;
switch (keyCode) {
case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD:
// something for fast forward
return true;
case KeyEvent.KEYCODE_MEDIA_NEXT:
// something for next
return true;
case KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE:
// something for play/pause
return true;
case KeyEvent.KEYCODE_MEDIA_PREVIOUS:
// something for previous
return true;
case KeyEvent.KEYCODE_MEDIA_REWIND:
// something for rewind
return true;
case KeyEvent.KEYCODE_MEDIA_STOP:
// something for stop
return true;
}
return false;
}

Jeff

On Apr 29, 8:20 am, gcstang gcst...@gmail.com wrote:
 I thought this was disabled at the OS levelotherwise wouldn't we
 be able to press to start a dialing app on our BT Headsets?

 On Apr 29, 1:31 am, mort m...@sto-helit.de wrote:



  Hi,

  it's pretty simple: add a broadcast listener to MEDIA_BUTTON:
  intent-filter android:priority=some number
      action android:name=android.intent.action.MEDIA_BUTTON /
  /intent-filter

  You need to give it a priority, which decides whether it's handled
  before or after other apps. In other words, it's pure coincidence who
  picked the highest number...
  If you handled the button press, you should abort the broadcast with
  abortBroadcast(). Trouble with this handling is, the priorities and
  abortBroadcast() work fine as long as each app only responds while
  e.g. something is played. But several users also expect a default
  player to be launched (or start playing) upon button press, like the
  default player, so it might happen some app with a higher priority
  number won't let the intent come through to your app... (I already
  filed an issue to improve 
  that:http://code.google.com/p/android/issues/detail?id=7772
  - no response so far...)

  In the onReceive, you can get the button event with
  KeyEvent key = (KeyEvent)
  intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT);

  key.getKeyAction() tells you whether the button was released or
  pressed, key.getKeyCode() tells which button. The values are
  documented and pretty self explaining, like KeyEvent.ACTION_DOWN or
  KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE.
  Regarding press and release, keep in mind several headsets do own
  processing which prevents this (like e.g. closing the connection or
  sending stop on long press on play/pause) or simply send both at
  once when the key is pressed or released. Also, some BT drivers are a
  bit unreliable in that regard...

  If you want to handle single button cable headsets as well, also
  regard the key code KEYCODE_HEADSETHOOK.

  btw: HTC Hero doesn't implement this standard, it needs a workaround
  app.

  HTH,
  Mirko

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

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

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


[android-developers] Re: 1.5 Not finding image resource!

2010-05-15 Thread Jeffrey
Thank you, though its wierd, when setting a 9 patch image as a button
background with setBackgroundResource(R.drawable.Filename) it's like
1.5 doesn't want to 9patch it or something, the image goes huge and
make the button bigger, where as 1.6 and higher leave the button size
along. Oh well, I got around it by setting the image immediately in
onCreate() so they the button doesn't grow later when clicked.

On May 15, 5:40 am, Kostya Vasilyev kmans...@gmail.com wrote:
 Jeffrey,

 Use -v4 suffix with alternate drawable folders to make them invisible
 to Android 1.5.

 So you'd have:

 res/drawable
 res/drawable-ldpi-v4
 res/drawable-hdpi-v4

 V4 means only use if API version is equal to or above 4, which is
 Android 1.6 with proper hdpi/ldpi handling. Android 1.5 will ignore
 -v4 folders and just use plain drawable.

 -- Kostya

 15.05.2010 6:11, Jeffrey пишет:





  That would make sense except that it tries to draw the image from
  drawable-nodpi before trying drawable. Also, the error isn't that the
  image is missing, it's that the image must be bigger than a 0 x 0
  image, which it is. For some reason 1.5 trying to read a 9patch from
  nodpi causes it to mess up.

  On May 14, 2:57 am, Guillermo 'YaW' Andradesloko...@gmail.com
  wrote:

  In 1.5 nodpi, hdpi, mdpi and ldpi doesn't exist. This terms
  were born in 1.6 so probably 1.5 doesn't recognize this folders.

  On 14 mayo, 07:36, Jeffreyjeffisagen...@gmail.com  wrote:

  Slight update, it turns out taking the resource out of the nodpi
  folder caused it to revert to the drawable folder and then it worked.
  Does anyone know why putting it in the nodpi would cause it to mess
  up? fyi the image in question is actually the default button image,
  taken out of the sdk resources, so there shouldn't be any issue with
  my image being messed up...

  On May 14, 12:23 am, Jeffreyjeffisagen...@gmail.com  wrote:

  I have an app that when run on 1.5 throws the following exception
  every time it tries to set an image:

  Resource not found exception blah blah blah

  caused by: Java.lang.IllegalArgumentException: width and height must
  be  0

  The image is being pulled from a drawable-nodpi folder, and all the
  dimensions are either wrap content or fill parent. I have no idea
  where it is getting values lower than zero.

  Is there something I am missing or what? Also the image I am trying to
  pull is a 9patch image, though I am referencing it the same way in
  another application just fine...

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

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

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

 --
 Kostya Vasilyev ~ WiFi Manager + pretty widget 
 ~http://kmansoft.wordpress.com/sw

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

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


[android-developers] Re: 1.5 Not finding image resource!

2010-05-14 Thread Jeffrey
That would make sense except that it tries to draw the image from
drawable-nodpi before trying drawable. Also, the error isn't that the
image is missing, it's that the image must be bigger than a 0 x 0
image, which it is. For some reason 1.5 trying to read a 9patch from
nodpi causes it to mess up.

On May 14, 2:57 am, Guillermo 'YaW' Andrades loko...@gmail.com
wrote:
 In 1.5 nodpi, hdpi, mdpi and ldpi doesn't exist. This terms
 were born in 1.6 so probably 1.5 doesn't recognize this folders.

 On 14 mayo, 07:36, Jeffrey jeffisagen...@gmail.com wrote:





  Slight update, it turns out taking the resource out of the nodpi
  folder caused it to revert to the drawable folder and then it worked.
  Does anyone know why putting it in the nodpi would cause it to mess
  up? fyi the image in question is actually the default button image,
  taken out of the sdk resources, so there shouldn't be any issue with
  my image being messed up...

  On May 14, 12:23 am, Jeffrey jeffisagen...@gmail.com wrote:

   I have an app that when run on 1.5 throws the following exception
   every time it tries to set an image:

   Resource not found exception blah blah blah

   caused by: Java.lang.IllegalArgumentException: width and height must
   be  0

   The image is being pulled from a drawable-nodpi folder, and all the
   dimensions are either wrap content or fill parent. I have no idea
   where it is getting values lower than zero.

   Is there something I am missing or what? Also the image I am trying to
   pull is a 9patch image, though I am referencing it the same way in
   another application just fine...

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

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

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

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


[android-developers] 1.5 Not finding image resource!

2010-05-13 Thread Jeffrey
I have an app that when run on 1.5 throws the following exception
every time it tries to set an image:

Resource not found exception blah blah blah


caused by: Java.lang.IllegalArgumentException: width and height must
be  0



The image is being pulled from a drawable-nodpi folder, and all the
dimensions are either wrap content or fill parent. I have no idea
where it is getting values lower than zero.

Is there something I am missing or what? Also the image I am trying to
pull is a 9patch image, though I am referencing it the same way in
another application just fine...

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

2010-05-13 Thread Jeffrey
Slight update, it turns out taking the resource out of the nodpi
folder caused it to revert to the drawable folder and then it worked.
Does anyone know why putting it in the nodpi would cause it to mess
up? fyi the image in question is actually the default button image,
taken out of the sdk resources, so there shouldn't be any issue with
my image being messed up...

On May 14, 12:23 am, Jeffrey jeffisagen...@gmail.com wrote:
 I have an app that when run on 1.5 throws the following exception
 every time it tries to set an image:

 Resource not found exception blah blah blah

 caused by: Java.lang.IllegalArgumentException: width and height must
 be  0

 The image is being pulled from a drawable-nodpi folder, and all the
 dimensions are either wrap content or fill parent. I have no idea
 where it is getting values lower than zero.

 Is there something I am missing or what? Also the image I am trying to
 pull is a 9patch image, though I am referencing it the same way in
 another application just fine...

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

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


[android-developers] audio player writing to AudioTrack

2010-05-12 Thread Jeffrey Palm
I've implemented an audio player that does decoding and decryption, so
writes to an AudioTrack object.  The decoding and decryption is done
in native code.  On the more powerful phones everything works fine,
but on the lower-power (e.g. HTC my touch) phones when I switch
activities the CPU becomes completely pegged and the audio becomes
crackly.  The first change was to keep the decoding and writing to the
AudioTrack entirely in native code, which seemed to help a little.
But, the audio still was bad, so, I re-factored out the portion of the
audio player class that is responsible for doing the actual playback
-- the rest of this class provides access to the meta data in the
file, which is in proprietary format -- and am running this as a
remote service.  The runs fine on the more powerful phones, but *only*
runs fine on the lower-power phones if I do the following:
 - start up the application
 - switch to another application
 - switch back to the application
 - start the audio player
Could anyone guess what switching to the other application does?  The
CPU usage graphs look the same for both the app and player processes
when doing this.

Thanks.
Jeff

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


[android-developers] APK not installing, permission request loop at install

2010-05-12 Thread Jeffrey
I have an app that is will work just fine if I install it directly via
ADB, but when I export it into an APK file it will not install,
whenever you try it loops on the permissions page, and instead of
installing when you click install or okay, it just opens that page
again. I have tried compiling it from two different computers with
different OS's, and I still have the same issue, what might be causing
this?

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


[android-developers] Re: SocketTimeoutException: Read Timed Out Occurs Only via Mobile

2010-05-11 Thread Jeffrey
I've been experiencing something similar using HttpClient (also using
URLConnection):

java.net.SocketTimeoutException: The operation timed out

The quick fix seems to be retrying the connection, but I'd like to
think there's a better way of handling it.

On May 4, 1:26 am, Paul Tongyoo paul.tong...@gmail.com wrote:
 Hi all--

 I'm receiving SocketTimeoutException: Read Timed Out errors in my client
 app when attempting to post image data to a central server over HTTPS.
 What's odd is that I cannot reproduce the error when posting data from my
 local machine (via the emulator) to the same server.  Increasing the
 SO_TIMEOUT value seems to only prolong the amount of time it takes for the
 timeout exception to occur.  I am very new to using the Apache HTTP API -
 what am I missing?

 HttpClient httpClient = new DefaultHttpClient();
 HttpConnectionParams.setSoTimeout(httpClient.getParams(), 15000);
 HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), 15000);
 HttpPost post = new HttpPost(https://;);

 ...

 HttpResponse response = httpClient.execute(post);  // Exception occurs here

 ...

 httpClient.getConnectionManager().shutdown();  // Closes the connection
 successfully?

 TIA
 Paul

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

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


[android-developers] log buffer size?

2010-05-09 Thread Jeffrey Blattman
how do i set the maximum log buffer size?

i see there is a logcat -r ... option, but it requires that i also specify
-f, which is the log file location. what's the location of the default
android log buffer file? poking around in the file system i can't see to
find it.

assuming i can find it, is it sufficient to do logcat -r nkb -f default
log location?

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] ProgressBar setMax(int) defaulting to 100

2010-04-26 Thread Jeffrey
I actually found the answer to this issue as I was about to post, but
I will post anyway to help anyone that might encounter this issue.
DO NOT set any progress or secondary progress amounts in the XML file
for the progress bar, this apparently prevents you from setting the
Max programmatically later.

I hope this helps.

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


[android-developers] Dialog not responding to fill_parent setting

2010-04-26 Thread Jeffrey
How do I fix this? I'm sure most of you have had this problem. I want
my dialog box to fill the screen as I have seekbars set on fill
parent, and so it makes this tiny dialog in the middle of the screen
with tiny seekbars to go along with it. This is really irritating as I
can't find any help anywhere!

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


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

2010-04-22 Thread Jeffrey
Moto Droid received in Southern California. Thank you Google!

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


[android-developers] Seek Bar .setFocusable(false) not working

2010-04-22 Thread Jeffrey
I need a seek bar to not be able to be adjusted, but without making
the color change... setFocusable does not work for this. Is there a
way to do this because it seems like there should be (without re-
writing the seekbar class that is).

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

2010-04-22 Thread Jeffrey
Note that setEnabled will not work for me as it darkens the color.


On Apr 22, 10:36 pm, Jeffrey jeffisagen...@gmail.com wrote:
 I need a seek bar to not be able to be adjusted, but without making
 the color change... setFocusable does not work for this. Is there a
 way to do this because it seems like there should be (without re-
 writing the seekbar class that is).

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

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


[android-developers] Re: ListView row floats out of place, scrolls different speed?

2010-04-04 Thread Jeffrey Blattman
to answer my own question (sort of), there were two objects in the list that
were equal according to my equals / hashcode. as this is a list i am not
sure why this would be a problem, but removing the unnecessary equals /
hashcode made it go away.

On Sun, Apr 4, 2010 at 9:55 AM, Jeffrey Blattman jeffrey.blatt...@gmail.com
 wrote:

 i have a list view. as i scroll, one of the elements in the list scrolls at
 a different rate and ends up floating above the other elements. i don't
 know how exactly to describe it, so i attached a pic screen cap. any ideas
 what would cause this?




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

To unsubscribe, reply using remove me as the subject.


[android-developers] Re: OnPause() - how to resume to an activity which has a Bundle passed to it when it is created

2010-03-12 Thread Jeffrey
What I have done with success in some of my apps is making several
parent views that hold each layout within a table layout, and use the
menu buttons to change the visibility of the parent view containing
the info you want them to see. Since the view is never really closed,
it's state is kept. Just use setVisibility(View.GONE) or View.VISIBILE
and it should keep everything good.

Just make sure that each button press hides all the other parent views
or else you will basically end up with two screens showing one after
the other.

On Mar 12, 7:21 am, TreKing treking...@gmail.com wrote:
 On Fri, Mar 12, 2010 at 12:28 AM, Prajakta Shitole 
 prajakt...@gmail.comwrote:

  One of my idea was to store the picture and the text view in the service
  and on click of a menu button navigate to another activity which will
  connect to the service and draw the stored pictures, text views in its
  activity.

 I haven't done anything like this but this seems like what you would want to
 do.

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

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


[android-developers] Re: application to run first time device is turned on

2010-02-26 Thread Jeffrey
You could always have a background service check a savedpreference
that returns false by default, and if it's false then it runs the
wizard, and when the wizard completes it saves the preference to true
or something along those lines.

On Feb 26, 6:57 pm, Yoav yoav.epst...@gmail.com wrote:
 Hi All,

 I am writing an application that is intended to run only once, the
 first time the user turns on their device.  We'll call it the setup
 wizard.  I wanted to know the proper way of doing this.

 I saw the following Settings.System.SETUP_WIZARD_HAS_RUN, but could
 not find anywhere in the SDK it is used to launch an application.

 I am aware of the Intent, android.intent.action.BOOT_COMPLETED, and
 could use it with Settings to launch my application.  I just wanted to
 know if this is the proper way to run the setup wizard.

 Just to make sure I'm clear, I'm developing an application that will
 come installed on a device, not an application the user will download
 from the market place.

 Thanks for any insights,

 Yoav

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


[android-developers] 2 Dimensional Array not initializing correctly

2010-02-17 Thread Jeffrey
I have a 2D array that I need to initialize. I have a class that holds
all my variables name V, so in that class I have this:

static String[][] ModelInfo = new String[300][25];

That should make 300 array variables with 25 points in it, but it
doesn't as any time I try to reference anything other than
V.ModelInfo[0][0] I get arrayindexoutofboundsexception.

I have tried initializing this in a for loop, but even that won't
work. I've tried this:

V.ModelInfo = new String[300][];
for(int ForNum = 0; ForNum  300; ForNum++){
V.ModelInfo[ForNum] = new String[25];
}
What the hell am I doing wrong? I found a work around at the moment
that does this:
for(int ForNum = 0; ForNum  300; ForNum++){
V.ModelInfo[ForNum] = new StoredArray; 
//StoredArray is
initialized as String[25].
}


Is there some trick to getting 2D arrays to actually work like they
are supposed to?

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

2010-02-17 Thread Jeffrey
fadden, it turns out the issue is with creating the array in a
different class. That is why your test program worked, because you
didn't actually recreate the situation I explained. I hope that this
helps anyone with the same issue that is looking for an answer.

On Feb 17, 8:16 pm, fadden fad...@android.com wrote:
 On Feb 17, 5:34 pm, Jeffrey jeffisagen...@gmail.com wrote:

  I have a 2D array that I need to initialize. I have a class that holds
  all my variables name V, so in that class I have this:

  static String[][] ModelInfo = new String[300][25];

  That should make 300 array variables with 25 points in it, but it
  doesn't as any time I try to reference anything other than
  V.ModelInfo[0][0] I get arrayindexoutofboundsexception.

 I tried a test program:

     public static void main(String[] args) {
         String[][] ModelInfo = new String[300][25];

         System.out.println(ModelInfo);
         System.out.println(ModelInfo[200]);
         System.out.println(ModelInfo[200][10]);
     }

 it output something like:

 [[Ljava.lang.String;@4aad3ba4
 [Ljava.lang.String;@3326b249
 null

 This seems to be the expected behavior - an array with 300 entries,
 each of which is an array with 25 entries, ready to hold strings.

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

2010-01-20 Thread Jeffrey
Well, I'm needing to save potentially over 1000 values in about 12 or
so arrays. I was kind of hoping that there was an easy way to save an
array and then load it back without having to do a bunch of stuff to
it. I'm not too experienced with programming so most of my knowledge
comes from reverse engineering examples I see, and I haven't been able
to find an example on saving a populated array and re-loading it
later.

What would be the best way to go about saving the data, since shared
preferences can't save a String[] type or an int[] type. If I mush
them all together into one item I don't know how to separate them
later.

On Jan 19, 10:12 pm, schwiz sch...@gmail.com wrote:
 you could use the xmlSerializer class to write an xml file and sax to
 read it back in

 On Jan 19, 9:23 pm, Charlie Collins charlie.coll...@gmail.com wrote:



  If your array is not too large, I agree with theSmith, using
  SharedPreferences is very easy if you are not sure about how to use
  other data storage approaches. If you store it as a String you could
  then parse it and rebuild the array.

  If you have a lot of data, you might want to go ahead and check out
  using a database. Here is a quick database example I wrote recently,
  in case it helps:http://www.screaming-penguin.com/node/7742.

  Also, here are some examples of writing and reading to 
  files:http://unlocking-android.googlecode.com/svn/chapter5/trunk/FileStorag
  See CreateFile for writing to a file, and ReadFile for reading the
  data back. These are a bit simplified, and the process is pretty raw,
  but the concepts are there.

  HTH

  On Jan 19, 8:25 pm, Jeffrey jeffisagen...@gmail.com wrote:

   How do I save the contents of an array to a file and then read it
   again later? I have a small amount of data that will need to be stored
   and since I have no idea where to start on using a SQLite database, I
   think this will work a lot better.
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Saving the contents of an array

2010-01-19 Thread Jeffrey
How do I save the contents of an array to a file and then read it
again later? I have a small amount of data that will need to be stored
and since I have no idea where to start on using a SQLite database, I
think this will work a lot better.
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Installing app on android device

2010-01-19 Thread Jeffrey
Also, exporting an UNSIGNED package is the main problem. Packages must
be signed in order to install. It's not hard to sign them as Android
allow self-signed packages. Just use the android tools menu and click
on export SIGNED package.

On Jan 19, 1:43 pm, Robert Nekic robertne...@gmail.com wrote:
 Now that I think about it...I seem to recall having trouble getting
 Astro to launch an apk.  I eventually installed a different file
 manager app from the Market, cleverly called File Manager.  I don't
 like the app very much but it does launch my apk.

 On Jan 19, 2:35 pm, Robert Nekic robertne...@gmail.com wrote:



  I've heard Archos killed some functionality regarding debugging/
  development with the Archos 5 Internet Tablet.  If you go to Settings,
  Applications, do you see a checkbox  at the top of the list for
  Unknown sources?  You probably have to uncheck that to get your apk
  to run.   Also, does that same Application settings list have a
  Development option at the bottom of the list?

  On Jan 19, 1:14 pm, fourk xav fou...@gmail.com wrote:

   Thanks guys !
   I manage to copy the apk already into my Archos, but when I launch it, it
   won't install. Error message saying, the application can not be installed 
   on
   this device... but it works perfectly on the emulator...
   any ideas?

   On Tue, Jan 19, 2010 at 7:07 PM, String 
   sterling.ud...@googlemail.comwrote:

On Jan 19, 2:43 pm, fourk xav fou...@gmail.com wrote:

 What about if you want to run the application on your DISCONNECTED
device?

You need to get the APK to the device somehow. By far the most direct
method is via USB, but if this isn't an option for some reason, you
still need to bridge that gap. Some possibilities:

- Copy the APK to an SD card on your development computer, then mount
that card on your phone and open th APK file using a File Manager app.
- Upload the APK file to a web server, then browse to its URL using
the browser on the device.

There are probably other means, but you will need to get the APK file
to the device one way or another.

String

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

[android-developers] Re: myTouch 3G developer phone

2010-01-19 Thread Jeffrey
No, it does not need service so it should work in it's current state.
There are quite a few posts on getting dev phones to work, so with
some searching I'm sure you can find one and get the issue resolved.

On Jan 18, 12:49 pm, heretic619 heretic...@gmail.com wrote:
 I have a myTouch 3G that currently is not connected to any service. I
 have been trying to use it as a dev phone but eclipse wont see it as
 proper target device. Does it need service for it to work?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: Android Pirate Site

2010-01-17 Thread Jeffrey Blattman
and co-pilot is hacked and available for free also. i guess that didn't
work.

On Sat, Jan 16, 2010 at 11:13 AM, theSmith chris.smith...@gmail.com wrote:

 Would it be feasible to authicate the app with a google checkout
 number like copilot does?


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

2010-01-11 Thread Jeffrey Blattman

bin and gen.

On 1/10/10 12:49 PM, barry wrote:

When using Eclipse as an IDE, which files/folders can I safely ignore
for version control purposes?

Thanks.
   


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

2010-01-11 Thread Jeffrey Blattman
why do you think it doesn't do the job? you can use https through either 
the java.net classes or their httpclient equivalents.


On 1/11/10 9:10 AM, Knossos wrote:

Hi,

I want to use HTTPS in my application. The Java URL class does not
seem to do the job.

Does anyone have any pointers?

Thanks!
Knossos.
   


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

2010-01-10 Thread Jeffrey Blattman
Do any of the other mobile OS developing organizations hand out free phones
to developers?

On Jan 9, 2010 11:12 PM, blindfold seeingwithso...@gmail.com wrote:

Probably not. Googlers got one for free, but us mortal developers are
not considered worthy of a similar treatment.

On Jan 10, 6:22 am, ian stilbit...@gmail.com wrote:  Does anybody know if
developers will be abl...

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

Re: [android-developers] Re: any nexus discount for developers?

2010-01-10 Thread Jeffrey Blattman
with the risk of coming across as inflammatory ... you should ask yourself
why you are here complaining about android and not somewhere else discussing
webos or iphone OS or windows mobile. there are lots of alternatives.

my reason is that i thought i could get in the ground floor. it turns out
the market was completely saturated when i got here, so oh well :) which
happens to be the reason why google doesn't have to give me extra special
hand holding. there's already a critical mass of developers. if i walk away
there's a million people willing to step in and write replicas of the silly
little apps i've published.

i wouldn't be surprised to hear that google does give assistance in special
cases ... with the agreement that they do not publicise the charity.

On Sun, Jan 10, 2010 at 6:55 AM, ian stilbit...@gmail.com wrote:

 Well considering the larger market for iPhones, especially in Canada,
 I guess the Apple developers probably get their money's worth.

 With the relentless rollout of newAndroid versions, the small market
 share, and the proliferation of proprietary brand variations, I don't
 think Android developers get the support they deserve.

 Google is rich already, and we're going to make them more money, They
 should invest in the developers, not charge us 100% markup on a dev
 phone.


 On Jan 10, 7:03 am, Yves Glodt y...@mind.lu wrote:
  2010/1/10 blindfold seeingwithso...@gmail.com
 
   Probably not. Googlers got one for free, but us mortal developers are
   not considered worthy of a similar treatment.
 
  about mortal developers...
 
  Lucky you are that you are not an iPhone dev... being harassed to buy a
 mac,
  plus at least $99 for being allowed to develop...
 
 
 
   On Jan 10, 6:22 am, ian stilbit...@gmail.com wrote:
Does anybody know if developers will be able to buy a Nexus for less
than $529?
 
 I need a phone for testing my apps soon but the price seems steep.
 
Also I'm worried 2,1 may break my apps, which are designed for 1.5.
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com
 
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en

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

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

[android-developers] Re: Nine patch pre-scaling on Hdpi

2010-01-05 Thread Jeffrey
The easiest thing I can think of is to make high density images and
see if that fixes the problem. I know that fix isn't the best but it
might work.

On Jan 5, 7:31 am, Pixie m...@labpixies.com wrote:
 Hello everyone,

 I have some 9-patch images on my app, and they work great on the
 medium density.
 When I load the app on a High density emulator/device, these images
 look grainy.
 It happens only to 9-patch images. The others look great after the pre-
 scaling.
 Is there a way to make them look good after the scaling, like the
 non-9-patch images?

 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] Patch 9 images and .setImageResource

2010-01-02 Thread Jeffrey
I have an image that is applied via setImageResource and it's a patch
9 but it is not stretching correctly. It is stretching the entire
image and I can't figure out why. Do I have to set a certain
ScaleType? I have tried with CENTER_CROP but it didn't seem to have
any efftect so I didn't try the others. Does anyone know why patch 9
files don't work in this situation?

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

2010-01-02 Thread Jeffrey
I think I found out why... Apparently there is a difference between
whatever.9.png and whatever.9.PNG...

On Jan 2, 2:39 am, Jeffrey jeffisagen...@gmail.com wrote:
 I have an image that is applied via setImageResource and it's a patch
 9 but it is not stretching correctly. It is stretching the entire
 image and I can't figure out why. Do I have to set a certain
 ScaleType? I have tried with CENTER_CROP but it didn't seem to have
 any efftect so I didn't try the others. Does anyone know why patch 9
 files don't work in this situation?

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


[android-developers] Draw() filling memory instantly

2009-12-31 Thread Jeffrey
I'm working on a game and right now I'm using the Lunar Lander sample
app as a template. The problem I'm encountering is running the draw
method I have. In the Lunar Lander app they use this:

run(){
while (mRun)
synchronized(mHandler)
DoDraw();

There is a little more to the code that I can't remember but the
problem I'm having is that they don't seem to be doing anything to
throttle the DoDraw command and make it draw slower. I'm trying the
same thing but as soon as the Run() command is called the first time
my memory immediately fills up and my apps stops working.

I am running the Run() command from an OnTouchEvent from the UI
Activity, and TouchEvents also change variables used by a method ran
at the same time as the DoDraw() command.

Is there anyone that could tell my why the lunar lander doesn't suffer
the same issue as mine? I put in a 100 millisecond delay and it worked
well, though it looked choppy. Is there a better way to do this or am
I just doing it wrong?

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


Re: [android-developers] AppWidget Update on Orientation Change

2009-12-30 Thread Jeffrey Blattman
I asked the same question some time back and the answer I received was that
there is no way to detect if your widget is visible, or currently shown on
the home screen.

On Dec 29, 2009 7:29 PM, Ryan rgra...@gmail.com wrote:

I am developing a photo frame widget, all works except on an
orientation change to landscape mode my appwidget doesn't display
correctly as I have it set to portrait dimensions and it is too large
for the display. I would like to run some code to resize the image so
that everything displays correctly and it uses all the space that I
allot.
What is the correct way to do this?
I can think of 2 methods however both seem inefficient. The first
would be to register a broadcast reciever to take orientation changes,
however I don't want to redo my appwidget everytime the phone is
turned on its side as the majority of the time the homescreen is not
showing when the orientation is changed (ie other apps are used, and I
don't need my code running in the background). I only need it to run
when the home screen is shown.
The second would be to setup a service to manage my appwidget but that
also seems inefficient to be always running in the background.

What is correct method to do this?

Thanks,

- Ryan

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

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

  1   2   >