[android-developers] OnCreate does not finish

2010-08-15 Thread kretes
Hi,

I would like to know what is going on with my app and Android system
when the onCreate() method in Application class doesn't finish.

In  onCreate() of the MyApplication extends Application class I have:

super.onCreate()
//do sth 1
log(1)
//do sth 2
log(2)
...

Usually when Android is creating the application I see 1 , 2 in my log
entries. However a few users have an issue that for 2 days Android is
keeping on restarting the app a few times, and always there is only
1 in the log.
So the onCreate method hasn't finished.

so it must be that while creating the app Android System decided that
there are not enough resources for my app.
Is my suspicion right? How can I do sth. with this - at least catch
and log such an event in a precise and sure way.

Thanks for any help,
Tomasz Bartczak
Automatic Sleep Log.

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

2010-08-15 Thread kretes
I don't know if it matters, but these are some operations - especially
here on Preferences and on SQlite Database, so they need some small
amount of processing.

On 15 Sie, 20:59, RichardC richard.crit...@googlemail.com wrote:
 What is sth?

 On Aug 15, 3:57 pm, kretes kretesena...@gmail.com wrote:

  Hi,

  I would like to know what is going on with my app and Android system
  when the onCreate() method in Application class doesn't finish.

  In  onCreate() of the MyApplication extends Application class I have:

  super.onCreate()
  //do sth 1
  log(1)
  //do sth 2
  log(2)
  ...

  Usually when Android is creating the application I see 1 , 2 in my log
  entries. However a few users have an issue that for 2 days Android is
  keeping on restarting the app a few times, and always there is only
  1 in the log.
  So the onCreate method hasn't finished.

  so it must be that while creating the app Android System decided that
  there are not enough resources for my app.
  Is my suspicion right? How can I do sth. with this - at least catch
  and log such an event in a precise and sure way.

  Thanks for any help,
  Tomasz Bartczak
  Automatic Sleep Log.

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

2010-02-02 Thread kretes
yes, my device wasn't entirely horizontal or vertical.

However what I am looking for is function that will give me the same
value when the device is not in movement, but in any position, it can
be on a slant, it can be almost vertically, or in unknown position in
some pocket, but without movement.

The problem is that I would like to be able to create a universal
function here, that would fit all accelerometer-enabled phones, not my
device.

I guess I will let the user calibrate it by putting it horizontal
without movement and calculating maximum 'real force', multiplying it
by some constant like 1.2.
Or additionally ignore first/second 'shakes' and process next one,
which fill be kind-of filter for the peaks.

Because I can't let myself accept any false positives.

If somebody have a better solution - please tell.

On 31 Sty, 23:11, Streets Of Boston flyingdutc...@gmail.com wrote:
 I'm not that familiar with how the sensor works, but judging from the
 values you report, i looks like the device is not entire horizontal or
 vertical.

 Your computeRealForce hovers around 0.4 (horizontally) or -1
 (vertically).

 I guess you have to find a proper 'baseline' against which you can
 measure any deviation. In the horizontal case that would be around
 0.4, in  the vertical case that would be around -1.

 However, it could be that your device was not precisely horizontal or
 precisely vertical. How would you know the 'baseline'? I don't know...
 Maybe 0 or -1 is precisely horizontal or vertical and you can't assume
 that your device will be ever exactly horizontal or vertical...

 I guess you have to measure over a period of time and see what the
 deviation is. If it's small enough, your phone is in rest.

 On Jan 31, 4:19 pm, kretes kretesena...@gmail.com wrote:

  There has been a few discussions about it, but there is still not a
  good solution.
  Simple problem - recognize when the device is laying somewhere not
  moving (in relation to earth) and when is moving.
  Accelerometer seems to be a good sensor to use.

  First suprise came to me, when I logged data from the sensor events.
  When the device (htc hero) is laying on the table - the values are
  changing!
  sth. like
  -0.7, -0.7, 10.1
  -0.6, -0.8, 10.0
  and so on - fluctuating

  I haven't expected that, but let's go on - I thought I woudl compute
  the real force, and went with

  private double computeRealForce(SensorEvent event) {
                  return Math.sqrt(Math.pow(event.values[0], 2)
                                  + Math.pow(event.values[1], 2)
                                  + Math.pow(event.values[2], 2))
                                  - SensorManager.GRAVITY_EARTH;

          }

  very similiar approach as seen 
  inhttp://github.com/commonsguy/cw-advandroid/blob/master/Sensor/Shaker/...
  and similiar 
  inhttp://www.anddev.org/example_detecting_-und-quotshake-und-quot_with_...

  and the computed value also fluctuates,
  0,35
  0,39
  0,4
  but I can apply force treshold like 0,5 as a kind of filter and
  everything is ok.

  But when I put my phone to stand vertically - suddenly my computed
  force turned out to be
  -1,01
  -1,05

  I give up - I don't know what is the good enough solution -
  the one that would give around zero value when the device isn't moving
  in relation to earth - is there any?



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


[android-developers] device shaked? accelerometer once more

2010-01-31 Thread kretes
There has been a few discussions about it, but there is still not a
good solution.
Simple problem - recognize when the device is laying somewhere not
moving (in relation to earth) and when is moving.
Accelerometer seems to be a good sensor to use.

First suprise came to me, when I logged data from the sensor events.
When the device (htc hero) is laying on the table - the values are
changing!
sth. like
-0.7, -0.7, 10.1
-0.6, -0.8, 10.0
and so on - fluctuating

I haven't expected that, but let's go on - I thought I woudl compute
the real force, and went with

private double computeRealForce(SensorEvent event) {
return Math.sqrt(Math.pow(event.values[0], 2)
+ Math.pow(event.values[1], 2)
+ Math.pow(event.values[2], 2))
- SensorManager.GRAVITY_EARTH;

}

very similiar approach as seen in
http://github.com/commonsguy/cw-advandroid/blob/master/Sensor/Shaker/src/com/commonsware/android/sensor/Shaker.java
and similiar in
http://www.anddev.org/example_detecting_-und-quotshake-und-quot_with_the_accelerometer-t4451.html

and the computed value also fluctuates,
0,35
0,39
0,4
but I can apply force treshold like 0,5 as a kind of filter and
everything is ok.

But when I put my phone to stand vertically - suddenly my computed
force turned out to be
-1,01
-1,05

I give up - I don't know what is the good enough solution -
the one that would give around zero value when the device isn't moving
in relation to earth - is there any?

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


[android-developers] How to maintain two copys of the same application on the phone?

2010-01-26 Thread kretes
I am looking for a best way to maintain development of an app with
data in sqlite.

I have one version of my app downloaded from the market and in use,
during usage it is gaining data - so I don't want to uninstall it, as
I want to perform an update, when the new version will be ready.

I want to independently develop next version on the same phone, but I
can't deploy app on the phone
a) because it's the same app - I can't deploy it like usual from
Eclipse - because it's using different certificate, so - is there a
way to use my keystore and certificate in normal, automated deploy in
Eclipse?
b) changing the name of the app isn't enough

I can change the package for the application and therefore deploy it
next to the old one, but changing package name is quite inconvenient,
especially that I will have to switch back before I publish new
version...

The best way would be to use the same certificate in automated way,
and just change name of the app - is that possible?

Regards,Tomek

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


[android-developers] Accelerometer listener stops getting events

2010-01-11 Thread kretes
I have a code which should run a lot of time in the background
listening for the accelerometer.
So i register listener and everything works fine. However sometimes
(once few hours or even days) - I stop getting events.
Looks like my listener was removed.
Is it possible for the sensor service to be 'reseted and loose its
listeners, or somehow to remove existing listeners (without having a
reference to listener)?

Or maybe somebody have some interesting ideas on how to debug such a
bug? :)
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] CheckedTextView and android:checkMark property

2009-11-15 Thread kretes
Why is that that a XML property
android:checkMark in CheckedTextView is not covered in doc
http://developer.android.com/reference/android/widget/CheckedTextView.html
?

Additionally - it looks that it is *required* attribute to use
CheckedTextView as a view in listview with checkboxes
Should i treat that as a kind-of-bug, or am I missing something?

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


[android-developers] android sources in eclipse and slow 'refreshing external folders'

2009-11-09 Thread kretes
I've set up sources for android from 
http://www.droidnova.com/android-sdk-1-6-donut-sources,511.html
according to issue 979 it's some way to get sources.

Sources are ok, finally I can dive into android code.

However on every build eclipse is 'refereshing external folders'
link1, which is pointing to my platform/andr*/sources directory. And
it's not that small (abut 90MB) to process unnoticed.
Does anybody know a way how to tell eclipse not to refresh that
directory? Come on, it's not changing at all - why refresh 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