[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-08-05 Thread Kaj Bjurman
It is taking precedence. Setting it to e.g. 2000M (using a 32 bit VM)
stops Eclipse from starting stating the normal could not create Java
virtual machine.

No, L: is a local disk. :)

Yes, 381.500 kB is about 381 MB .

The 32 bit VM on my OS can create a VM with more than 1GB as Xmx, the
limit is close to what I use as an argument. Trying to set -Xmx to a
too large value will stop the VM from starting, at startup time, and
not later.

I talked to another developer who also is writing Android
applications .He has not had any problems on a 32 bit version of
Windows. (I'm using Windows Vista Ultimate 64 bit)



On 5 Aug, 09:09, Bob Kerns r...@acm.org wrote:
 OK. I'm not 100% certain that the command line will take precedence
 over the eclipse.ini. You might want to edit the -Xmx512m there.

 Except that with a drive letter like L:, I'm surmising that you're
 running it from a network share? This may cause some significant
 performance problems, and is not something I would recommend. That
 wouldn't cause you to run out of memory, though. But you might want to
 experiment with a local copy.

 Private working set is not relevant to running out of memory. working
 set merely indicates, out of all the memory allocated in this
 process, how much is actually in RAM? It is relevant to competing for
 RAM with other processes, and thus paging slowdowns.

 By Commit size is now 381.500 kB, you mean 381.5 MB? For this one
 process? (Just checking). That is perhaps about right for a setting of
 -Xmx512m, with the GC factored in, etc. It is not consistent with
 running out of a  1GB allocation. (And I'm not sure the 32-bit
 version of Java can actually handle a heap of that size; I don't
 recall the limit, but I think you're not that far from it at best. I
 do recall it changing from release to release and finding a server
 stopped working as a result...) So one possibility is that the Eclipse
 launcher may be dropping that setting without telling you, just
 because it's too big.

 One thing you can do, if you haven't already: In Eclipse, go to
 Windows / Preferences... / General and check Show Heap Status. This
 puts a field in the status bar that shows Java's idea of how much Java
 heap it has allocated, and the current limit (i.e. the upper number
 will grow from -XmsXXXm to -XmxYYYm). This is an easy way to see
 Eclipse's GC status.

 On Aug 4, 10:37 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Eclipse is started using a shortcut:

  Galileo
  L:\eclipse-jee-galileo-win32\eclipse\eclipse.exe -vmargs -Xmx1324m

  Ganymede
  L:\eclipse\eclipse.exe -vmargs -Xmx1324m

  (I'm having the same problem in both)

  eclipse.ini says:

  --launcher.library
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
  -startup
  plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
  -product
  org.eclipse.epp.package.jee.product
  --launcher.XXMaxPermSize
  256M
  -showsplash
  org.eclipse.platform
  --launcher.XXMaxPermSize
  256m
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx512m

  The java version that is in path:

  java version 1.6.0_13
  Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
  Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

  I only checked the process in task manager, but I also made the
  columns for handles, threads and user objects visible. The number of
  threads was only about 40 which surprised me. (An fresh started
  Eclipse on my system has about 28 threads)

  Memory (Private working set) was about 400.000 kB. I did not check
  commit size, I tonigh when I got time to provoke Eclipse again. The
  paging size looked normal.

  I now saw that that Eclipse only used revision 5 of the Android SDK
  Tools. I started a fresh Eclipse, opened up Android SDK and AVD
  Manager, selected to install all available packages, and then bumbed
  into the same error again (so it took less than 2 minutes)

  Commit size is now 381.500 kB, Private working set 327.048 kB, Threads
  26, Handles 506

  On 5 Aug, 03:44, Bob Kerns r...@acm.org wrote:

   OK, this is good information. You are, in fact, running out of memory
   -- somehow.

   I've see this, but seldom as performance starts to suck for me long
   before.

   How exactly are you allocating memory for Java? How are you starting
   Eclipse?

   And when you were checking how much memory Eclipse was using, how did
   you check that, exactly? It sounds like you used the task manager --
   what is the exact title of the column you used? Task manager is not
   ideal for looking at this, but the only column that is actually
   relevant out of the 7 memory columns available is Memory - Commit
   size.  But the relationship between that and Java's GC'd heap memory
   allocation is tenuous. About the only thing you can say is that Memory
   - Commit size will be greater than the amount of memory Java is
   actively using in its heap.

   Did you check your paging file space? That's another way you can run

[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-08-05 Thread Kaj Bjurman
Btw. I'm actually not sure that the problem really is an out of memory
exception. Yes, the log says so, but I think it's caused by an other
unhandled exception, and then something is catching that exception and
throws an out of memory exception. Don't know why, but that is a hunch
that I get.



On 5 Aug, 09:09, Bob Kerns r...@acm.org wrote:
 OK. I'm not 100% certain that the command line will take precedence
 over the eclipse.ini. You might want to edit the -Xmx512m there.

 Except that with a drive letter like L:, I'm surmising that you're
 running it from a network share? This may cause some significant
 performance problems, and is not something I would recommend. That
 wouldn't cause you to run out of memory, though. But you might want to
 experiment with a local copy.

 Private working set is not relevant to running out of memory. working
 set merely indicates, out of all the memory allocated in this
 process, how much is actually in RAM? It is relevant to competing for
 RAM with other processes, and thus paging slowdowns.

 By Commit size is now 381.500 kB, you mean 381.5 MB? For this one
 process? (Just checking). That is perhaps about right for a setting of
 -Xmx512m, with the GC factored in, etc. It is not consistent with
 running out of a  1GB allocation. (And I'm not sure the 32-bit
 version of Java can actually handle a heap of that size; I don't
 recall the limit, but I think you're not that far from it at best. I
 do recall it changing from release to release and finding a server
 stopped working as a result...) So one possibility is that the Eclipse
 launcher may be dropping that setting without telling you, just
 because it's too big.

 One thing you can do, if you haven't already: In Eclipse, go to
 Windows / Preferences... / General and check Show Heap Status. This
 puts a field in the status bar that shows Java's idea of how much Java
 heap it has allocated, and the current limit (i.e. the upper number
 will grow from -XmsXXXm to -XmxYYYm). This is an easy way to see
 Eclipse's GC status.

 On Aug 4, 10:37 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Eclipse is started using a shortcut:

  Galileo
  L:\eclipse-jee-galileo-win32\eclipse\eclipse.exe -vmargs -Xmx1324m

  Ganymede
  L:\eclipse\eclipse.exe -vmargs -Xmx1324m

  (I'm having the same problem in both)

  eclipse.ini says:

  --launcher.library
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
  -startup
  plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
  -product
  org.eclipse.epp.package.jee.product
  --launcher.XXMaxPermSize
  256M
  -showsplash
  org.eclipse.platform
  --launcher.XXMaxPermSize
  256m
  -vmargs
  -Dosgi.requiredJavaVersion=1.5
  -Xms40m
  -Xmx512m

  The java version that is in path:

  java version 1.6.0_13
  Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
  Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

  I only checked the process in task manager, but I also made the
  columns for handles, threads and user objects visible. The number of
  threads was only about 40 which surprised me. (An fresh started
  Eclipse on my system has about 28 threads)

  Memory (Private working set) was about 400.000 kB. I did not check
  commit size, I tonigh when I got time to provoke Eclipse again. The
  paging size looked normal.

  I now saw that that Eclipse only used revision 5 of the Android SDK
  Tools. I started a fresh Eclipse, opened up Android SDK and AVD
  Manager, selected to install all available packages, and then bumbed
  into the same error again (so it took less than 2 minutes)

  Commit size is now 381.500 kB, Private working set 327.048 kB, Threads
  26, Handles 506

  On 5 Aug, 03:44, Bob Kerns r...@acm.org wrote:

   OK, this is good information. You are, in fact, running out of memory
   -- somehow.

   I've see this, but seldom as performance starts to suck for me long
   before.

   How exactly are you allocating memory for Java? How are you starting
   Eclipse?

   And when you were checking how much memory Eclipse was using, how did
   you check that, exactly? It sounds like you used the task manager --
   what is the exact title of the column you used? Task manager is not
   ideal for looking at this, but the only column that is actually
   relevant out of the 7 memory columns available is Memory - Commit
   size.  But the relationship between that and Java's GC'd heap memory
   allocation is tenuous. About the only thing you can say is that Memory
   - Commit size will be greater than the amount of memory Java is
   actively using in its heap.

   Did you check your paging file space? That's another way you can run
   out of memory.

   And finally, it may report this error when you've run out of native
   threads.  That is, in fact, WHERE you are running out of memory,
   though it may not be the specific cause. Check the Threads column.

   With Galileo, and Rev 6 of the Android SDK tools, I don't see a thread
   leak. In fact

[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-08-04 Thread Kaj Bjurman
I think it was stated previously in this thread. The problem isn't
Eclipse. The problem is the Android plugin. I'm using Eclipse more
than 8h per day at work, and I don't have any problems there (I'm not
doing any Android development at work). I can also use Eclipse at home
without any problems if I never switch to the design view, or edit
Android xml files. Switching to design view or editing xml files means
that my Eclipse (tested several different versions) craches within one
hour. Often several times per hour, and it's always a related to a
memory problem, and it's due to leaking handles. Looks like it's
either directly related to editing, or generation of R.

(And I'm having a 64 bit machine with 8 GB of RAM)


On 4 Aug, 13:46, Jonas Petersson jonas.peters...@xms.se wrote:
 Ah, I think I can relate to that statement: for 95+% of the XML editing
 I referred to I used Eclipse itself, but like Kostya I stayed mostly in
 the XML view, only an occasional glance at the graphical layout since
 (at least for my cases) I decided the visual layout could not really be
 trusted. Showing it in the emulator was the only way to know that it
 actually worked as expected (yes, I had a rather picky spec to follow
 and in a few cases I actually pulled out emacs for significant
 restructuring, so I may have accidentally been lucky to manage for a week).

                         Best / Jonas

 On 08/04/2010 11:55 AM, Kostya Vasilyev wrote:



  This looks likely.

  I can run Eclipse all day on a 4G Windows 64bit machine, but I edit my
  layouts by hand, without the visual editor.

  04.08.2010 11:00, Mystique пишет:
  I think there's some memory leak issue if editing XML files.
  I realise if I only open .java it is ok.
  So maybe a temp work around is to edit xml file with editor and open
  only .java in eclipse?

  On Aug 4, 10:17 am, Dougbeafd...@gmail.com wrote:
  The issue isn't what else is running on the computer. The issue is
  that Eclipse gets into an unrecoverable state where it lags horribly
  when switching between editors, at least on OSX. I can typically go 5
  or 6 hours of steady use (more with intermittent use) until that state
  kicks in for me (MacBook Pro, 4GB, 2.4GHz Core 2 Duo). Quitting other
  apps at that point doesn't make any difference. The resource leak
  explanation is the only one that makes sense given my observations,
  which are daily since I do this to pay my mortgage.

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


[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-08-04 Thread Kaj Bjurman
(Unknown Source)
at java.lang.System.runFinalization(Unknown Source)
at org.eclipse.ui.internal.ide.application.IDEIdleHelper
$3.run(IDEIdleHelper.java:182)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.core.resources 8 2 2010-08-04 22:45:53.521
!MESSAGE Problems occurred when invoking code from plug-in:
org.eclipse.core.resources.
!STACK 1
org.eclipse.core.runtime.CoreException: 'aapt' error. Pre Compiler
Build aborted.
at
com.android.ide.eclipse.adt.internal.build.BaseBuilder.stopBuild(Unknown
Source)
at
com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.build(Unknown
Source)
at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:627)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
170)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
201)
at org.eclipse.core.internal.events.BuildManager
$1.run(BuildManager.java:253)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
256)
at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:
309)
at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:
341)
at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:
140)
at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:
238)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2010-08-04 22:45:53.521
!MESSAGE 'aapt' error. Pre Compiler Build aborted.
!SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2010-08-04 22:45:53.521
!MESSAGE 'aapt' error. Pre Compiler Build aborted.









On 4 Aug, 18:54, DanH danhi...@ieee.org wrote:
 The Eclipse UI editor for Qt (which is similarly XML based) exhibits
 similar behavior -- some things you can do OK, but certain complex
 operations crash the editor (and sometimes Eclipse) with fair
 regularity.  You learn to save your layouts frequently.

 Re poor performance in general, folks with Win64 should start Task
 Manager from time to time and note CPU usage.  There is a bug rampant
 in Vista and not unlikely in Win7 that causes some sort of background
 activity causing 40-60% CPU utilization, with nothing else going on,
 and no process showing more than 2%.  (System Idle Process shows
 85-90%.)  Folks with desktop boxes might miss this, but folks with
 laptops notice it because the CPU fan is running full bore when
 nothing is going on.  Once this scenario starts you can only kill it
 by rebooting or hibernating.

 Another performance killer is the Windows indexing service.

 On Aug 4, 10:00 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  I think it was stated previously in this thread. The problem isn't
  Eclipse. The problem is the Android plugin. I'm using Eclipse more
  than 8h per day at work, and I don't have any problems there (I'm not
  doing any Android development at work). I can also use Eclipse at home
  without any problems if I never switch to the design view, or edit
  Android xml files. Switching to design view or editing xml files means
  that my Eclipse (tested several different versions) craches within one
  hour. Often several times per hour, and it's always a related to a
  memory problem, and it's due to leaking handles. Looks like it's
  either directly related to editing, or generation of R.

  (And I'm having a 64 bit machine with 8 GB of RAM)

  On 4 Aug, 13:46, Jonas Petersson jonas.peters...@xms.se wrote:

   Ah, I think I can relate to that statement: for 95+% of the XML editing
   I referred to I used Eclipse itself, but like Kostya I stayed mostly in
   the XML view, only an occasional glance at the graphical layout since
   (at least for my cases) I decided the visual layout could not really be
   trusted. Showing it in the emulator was the only way to know that it
   actually worked as expected (yes, I had a rather picky spec to follow
   and in a few cases I actually pulled out emacs for significant
   restructuring, so I may have accidentally been lucky to manage for a 
   week).

                           Best / Jonas

   On 08/04/2010 11:55 AM, Kostya Vasilyev wrote:

This looks likely.

I can run Eclipse all day on a 4G Windows 64bit machine, but I edit my
layouts by hand, without the visual editor.

04.08.2010 11:00, Mystique пишет:
I think there's some memory leak issue if editing XML files.
I realise if I only open .java it is ok.
So maybe a temp work around is to edit xml file with editor and open
only .java in eclipse?

On Aug 4, 10:17 am, Dougbeafd...@gmail.com wrote:
The issue isn't what else is running on the computer. The issue is
that Eclipse gets

[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-08-04 Thread Kaj Bjurman
Eclipse is started using a shortcut:

Galileo
L:\eclipse-jee-galileo-win32\eclipse\eclipse.exe -vmargs -Xmx1324m

Ganymede
L:\eclipse\eclipse.exe -vmargs -Xmx1324m

(I'm having the same problem in both)

eclipse.ini says:



--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m


The java version that is in path:

java version 1.6.0_13
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

I only checked the process in task manager, but I also made the
columns for handles, threads and user objects visible. The number of
threads was only about 40 which surprised me. (An fresh started
Eclipse on my system has about 28 threads)

Memory (Private working set) was about 400.000 kB. I did not check
commit size, I tonigh when I got time to provoke Eclipse again. The
paging size looked normal.

I now saw that that Eclipse only used revision 5 of the Android SDK
Tools. I started a fresh Eclipse, opened up Android SDK and AVD
Manager, selected to install all available packages, and then bumbed
into the same error again (so it took less than 2 minutes)

Commit size is now 381.500 kB, Private working set 327.048 kB, Threads
26, Handles 506






On 5 Aug, 03:44, Bob Kerns r...@acm.org wrote:
 OK, this is good information. You are, in fact, running out of memory
 -- somehow.

 I've see this, but seldom as performance starts to suck for me long
 before.

 How exactly are you allocating memory for Java? How are you starting
 Eclipse?

 And when you were checking how much memory Eclipse was using, how did
 you check that, exactly? It sounds like you used the task manager --
 what is the exact title of the column you used? Task manager is not
 ideal for looking at this, but the only column that is actually
 relevant out of the 7 memory columns available is Memory - Commit
 size.  But the relationship between that and Java's GC'd heap memory
 allocation is tenuous. About the only thing you can say is that Memory
 - Commit size will be greater than the amount of memory Java is
 actively using in its heap.

 Did you check your paging file space? That's another way you can run
 out of memory.

 And finally, it may report this error when you've run out of native
 threads.  That is, in fact, WHERE you are running out of memory,
 though it may not be the specific cause. Check the Threads column.

 With Galileo, and Rev 6 of the Android SDK tools, I don't see a thread
 leak. In fact, my thread count was initially 47, went up to 52 briefly
 while auto-building my project, and then as I started looking at
 layouts, it has gone down to 37, and I don't seem to find anything
 with layouts that bumps it up at all.

 If you see a different behavior, then we have a clue. (Otherwise, it's
 still a clue, but a weak one).

 On Aug 4, 2:00 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  I just provoked my Eclipse again, just to see what the error message
  is. I remembered it as out of handles, but that was a bit wrong. I
  checked the process in the task manager when it was in the error
  state. It isn't out of memory, and it's probably not out of handles.
  The CPUs are also idle, so nothing is spinning.

  The error from Eclipse is a dialog that says:

  Multiple problems have occured (as title)

  The error message is then, unable to create new native thread.

  Followed by a textfield that is displaying:

  Collecting garbage
  Collecting garbage
  Unhandled event loop exception

  unable to create new native thread

  The eclipse error log can be seen below.

  Eclipse was at that time taking about 400 MB of memory (of the 1300M
  that I had assigned to the VM)

  It took me about 10-15 minutes. All I did was editing one layout file,
  switched between layout view, then edited the xml directly, changed
  some properties through the property view, saved quite frequently,
  even with compilation errors, and also tried keep editing while it was
  saving.

  This never happens when I write code in Eclipse.

  !ENTRY org.eclipse.core.resources 8 2 2010-08-04 22:40:49.414
  !MESSAGE Problems occurred when invoking code from plug-in:
  org.eclipse.core.resources.
  !STACK 1
  org.eclipse.core.runtime.CoreException: 'aapt' error. Pre Compiler
  Build aborted.
          at
  com.android.ide.eclipse.adt.internal.build.BaseBuilder.stopBuild(Unknown
  Source)
          at
  com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.build(Unknown
  Source)
          at org.eclipse.core.internal.events.BuildManager
  $2.run(BuildManager.java:627)
          at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42

[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-08-04 Thread Kaj Bjurman
(And the workspace is using 1.5.0_19)

On 5 Aug, 03:44, Bob Kerns r...@acm.org wrote:
 OK, this is good information. You are, in fact, running out of memory
 -- somehow.

 I've see this, but seldom as performance starts to suck for me long
 before.

 How exactly are you allocating memory for Java? How are you starting
 Eclipse?

 And when you were checking how much memory Eclipse was using, how did
 you check that, exactly? It sounds like you used the task manager --
 what is the exact title of the column you used? Task manager is not
 ideal for looking at this, but the only column that is actually
 relevant out of the 7 memory columns available is Memory - Commit
 size.  But the relationship between that and Java's GC'd heap memory
 allocation is tenuous. About the only thing you can say is that Memory
 - Commit size will be greater than the amount of memory Java is
 actively using in its heap.

 Did you check your paging file space? That's another way you can run
 out of memory.

 And finally, it may report this error when you've run out of native
 threads.  That is, in fact, WHERE you are running out of memory,
 though it may not be the specific cause. Check the Threads column.

 With Galileo, and Rev 6 of the Android SDK tools, I don't see a thread
 leak. In fact, my thread count was initially 47, went up to 52 briefly
 while auto-building my project, and then as I started looking at
 layouts, it has gone down to 37, and I don't seem to find anything
 with layouts that bumps it up at all.

 If you see a different behavior, then we have a clue. (Otherwise, it's
 still a clue, but a weak one).

 On Aug 4, 2:00 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  I just provoked my Eclipse again, just to see what the error message
  is. I remembered it as out of handles, but that was a bit wrong. I
  checked the process in the task manager when it was in the error
  state. It isn't out of memory, and it's probably not out of handles.
  The CPUs are also idle, so nothing is spinning.

  The error from Eclipse is a dialog that says:

  Multiple problems have occured (as title)

  The error message is then, unable to create new native thread.

  Followed by a textfield that is displaying:

  Collecting garbage
  Collecting garbage
  Unhandled event loop exception

  unable to create new native thread

  The eclipse error log can be seen below.

  Eclipse was at that time taking about 400 MB of memory (of the 1300M
  that I had assigned to the VM)

  It took me about 10-15 minutes. All I did was editing one layout file,
  switched between layout view, then edited the xml directly, changed
  some properties through the property view, saved quite frequently,
  even with compilation errors, and also tried keep editing while it was
  saving.

  This never happens when I write code in Eclipse.

  !ENTRY org.eclipse.core.resources 8 2 2010-08-04 22:40:49.414
  !MESSAGE Problems occurred when invoking code from plug-in:
  org.eclipse.core.resources.
  !STACK 1
  org.eclipse.core.runtime.CoreException: 'aapt' error. Pre Compiler
  Build aborted.
          at
  com.android.ide.eclipse.adt.internal.build.BaseBuilder.stopBuild(Unknown
  Source)
          at
  com.android.ide.eclipse.adt.internal.build.PreCompilerBuilder.build(Unknown
  Source)
          at org.eclipse.core.internal.events.BuildManager
  $2.run(BuildManager.java:627)
          at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
          at
  org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
  170)
          at
  org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
  201)
          at org.eclipse.core.internal.events.BuildManager
  $1.run(BuildManager.java:253)
          at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
          at
  org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:
  256)
          at
  org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.j 
  ava:
  309)
          at
  org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:
  341)
          at
  org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:
  140)
          at
  org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:
  238)
          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
  !SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2010-08-04 22:40:49.414
  !MESSAGE 'aapt' error. Pre Compiler Build aborted.
  !SUBENTRY 1 com.android.ide.eclipse.adt 8 0 2010-08-04 22:40:49.414
  !MESSAGE 'aapt' error. Pre Compiler Build aborted.

  !ENTRY org.eclipse.ui 4 0 2010-08-04 22:45:29.067
  !MESSAGE Unhandled event loop exception
  !STACK 0
  java.lang.OutOfMemoryError: unable to create new native thread
          at java.lang.Thread.start0(Native Method)
          at java.lang.Thread.start(Unknown Source)
          at org.eclipse.jface.text.contentassist.AdditionalInfoController
  $Timer.init

[android-developers] Re: My Eclipse 3.5 always lag and have to force close - why?

2010-07-30 Thread Kaj Bjurman
It has unfortunately been like that for ages (if you are modifying
e.g. layout files). It doesn't happen if you only write code.

It looks like the Android plugin is leaking resources, and fast.

On 30 Juli, 13:22, Mystique joven.ch...@gmail.com wrote:
 Hi,

 I'm on Win7 32-bit with 4GB RAM. Why my Eclipse always become so slow
 until it take so long to response to my mouse or keyboard. I have to
 force terminate it, restart and use it for like 20min and repeat the
 same thing again...

 Anyone facing this or have experience dealing with it?

 Regards.

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


[android-developers] Re: Android market rules are changed, you must accept it within 30 days but...

2010-07-27 Thread Kaj Bjurman
What website? I would say that it isn't even close to 1/6 of Android
phones/users that find applications outside of the official Android
Market. I guess it can get close to 1/6 if people first have seen the
application on official Android Market, and then decides to buy it,
and sees that they have to do it through another market. (And that
will no longer be possible if I have understood it correct)



On 26 Juli, 16:15, Pent tas...@dinglisch.net wrote:
   How many Android users (especially as Android phones becomes more
   mainstream) will venture outside of the offical Android market?

  My experience up to now has been almost zero.

 Mine is 1/6 (direct from website).

 Pent

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


[android-developers] Re: Android Market Licensing: Now Available!

2010-07-27 Thread Kaj Bjurman
I saw that entry, and have a question.

What will happen if the user doesn't have network connectivity? Many
users turn of data traffic when they travel to other countries, but
the probably still want to use the licensed applications.



On 27 Juli, 19:55, Trevor Johns trevorjo...@google.com wrote:
 Android fans,
 For those of you who haven't already heard through our blog, we've
 just launched the Android Market licensing service:

 http://android-developers.blogspot.com/2010/07/licensing-service-for-...

 From the above blog post:

 This simple and free service provides a secure mechanism to manage
 access to all Android Market paid applications targeting Android 1.5
 or higher. At run time, with the inclusion of a set of libraries
 provided by us, your application can query the Android Market
 licensing server to determine the license status of your users. It
 returns information on whether your users are authorized to use the
 app based on stored sales records.

 Developer documentation is available here:

 http://developer.android.com/guide/publishing/licensing.html

 Happy coding!

 --
 Trevor Johns
 Google Developer Programs, Androidhttp://developer.android.com

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


[android-developers] Re: Licensing

2010-07-27 Thread Kaj Bjurman
Many (most?) Android developers can still not sell applications on
Android market, and people who got free apps usually don't care about
licensing.



On 27 Juli, 19:29, Chris Stewart cstewart...@gmail.com wrote:
 With the just announced licensing feature for Android 
 (http://developer.android.com/guide/publishing/licensing.html), I'm curious
 to hear what you all think about it.  Is piracy a big enough problem on
 Android that this is a breath of fresh air, or more of a precaution for the
 future?

 Chris Stewart
 cstewart...@gmail.comhttp://www.androidsdkforum.com

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


[android-developers] Re: App Inventor to Market

2010-07-16 Thread Kaj Bjurman
(Sorry for the hijacking)

I don't agree at all. I don't have a clue on how Google apply their
sorting, but the result is neither sorted by rating nor downloads. I
got an app with 4.39 in rating, and about 77000 downloads.

I now did a market search of parts of my application name, and my
application came rather low in that search, and there were many apps
with a rating of 2-4 and much fewer downloads that had a higher
ranking, and didn't even contain my search criteria in the name.

I think Market search sucks big time.


On 15 Juli, 23:53, Greg Donald gdon...@gmail.com wrote:
 On Thu, Jul 15, 2010 at 3:39 PM, TreKing treking...@gmail.com wrote:
  Your definition of filter confuses me.

 I apologize for the confusion.  I meant it in the sense of sorting
 more than filtering.  Low quality Android apps appear near the bottom
 of the lists while higher quality apps appear closer to the top.  The
 filtering occurs when the user gets tired of scrolling down.

 --
 Greg Donald
 destiney.com | gregdonald.com

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


[android-developers] Re: App Inventor to Market

2010-07-16 Thread Kaj Bjurman
Probably not, I updated my application less than 1 week ago, and had
another release a month prior to that.


On 16 Juli, 10:16, Mark Carter mjc1...@googlemail.com wrote:
 (Also, apologies for continuing the tangential discussion)

 Same thing happening to one of my apps. Even though the download count
 is increasing healthily (and a 4.5 rating), I think its because I
 haven't updated it for a couple of months.

 Could that be it?

 On Jul 16, 8:41 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  (Sorry for the hijacking)

  I don't agree at all. I don't have a clue on how Google apply their
  sorting, but the result is neither sorted by rating nor downloads. I
  got an app with 4.39 in rating, and about 77000 downloads.

  I now did a market search of parts of my application name, and my
  application came rather low in that search, and there were many apps
  with a rating of 2-4 and much fewer downloads that had a higher
  ranking, and didn't even contain my search criteria in the name.

  I think Market search sucks big time.

  On 15 Juli, 23:53, Greg Donald gdon...@gmail.com wrote:

   On Thu, Jul 15, 2010 at 3:39 PM, TreKing treking...@gmail.com wrote:
Your definition of filter confuses me.

   I apologize for the confusion.  I meant it in the sense of sorting
   more than filtering.  Low quality Android apps appear near the bottom
   of the lists while higher quality apps appear closer to the top.  The
   filtering occurs when the user gets tired of scrolling down.

   --
   Greg Donald
   destiney.com | gregdonald.com

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


[android-developers] Re: App Inventor to Market

2010-07-16 Thread Kaj Bjurman
No, the app just above mine in the search result has a rating of less
than 3, and had something like 3 comments. Mine has more than 100
comments.

I checked when the last update of that application was done, and that
was something like 200 hours ago, and mine was updated about 100 hours
ago. My application is however older. I wonder if that makes any
difference.



On 16 Juli, 16:09, Shane Isbell shane.isb...@gmail.com wrote:
 There could be all sorts of reasons for this. For example, google may be
 increasing the visibility on the app based on user comment activity and
 detail views, so even a lot of 'This sucks' comments helps it out. Do these
 crapps with better visibility have a lot more comments?





 On Fri, Jul 16, 2010 at 1:33 AM, Kaj Bjurman kaj.bjur...@gmail.com wrote:
  Probably not, I updated my application less than 1 week ago, and had
  another release a month prior to that.

  On 16 Juli, 10:16, Mark Carter mjc1...@googlemail.com wrote:
   (Also, apologies for continuing the tangential discussion)

   Same thing happening to one of my apps. Even though the download count
   is increasing healthily (and a 4.5 rating), I think its because I
   haven't updated it for a couple of months.

   Could that be it?

   On Jul 16, 8:41 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:

(Sorry for the hijacking)

I don't agree at all. I don't have a clue on how Google apply their
sorting, but the result is neither sorted by rating nor downloads. I
got an app with 4.39 in rating, and about 77000 downloads.

I now did a market search of parts of my application name, and my
application came rather low in that search, and there were many apps
with a rating of 2-4 and much fewer downloads that had a higher
ranking, and didn't even contain my search criteria in the name.

I think Market search sucks big time.

On 15 Juli, 23:53, Greg Donald gdon...@gmail.com wrote:

 On Thu, Jul 15, 2010 at 3:39 PM, TreKing treking...@gmail.com
  wrote:
  Your definition of filter confuses me.

 I apologize for the confusion.  I meant it in the sense of sorting
 more than filtering.  Low quality Android apps appear near the bottom
 of the lists while higher quality apps appear closer to the top.  The
 filtering occurs when the user gets tired of scrolling down.

 --
 Greg Donald
 destiney.com | gregdonald.com

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

 --
 Shane Isbell (Founder of ZappMarket)http://apps.facebook.com/zappmarket/

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


[android-developers] Re: Is it normal that a real device fps is much different then emulator?

2010-07-08 Thread Kaj Bjurman
The speed in the emulator is related to the performance of your
computer. I do e.g. get a very bad refresh rate on my laptop, and
better refresh rates on my desktop.

Rendering on my phone (nexus one) has always performed better than the
emulator in my case.


On 8 Juli, 08:29, kevin0228ca kevin022...@gmail.com wrote:
 btw, I also noticed that emulator with smaller resolution(HVGA) has
 better fps than WVGA.
 does this imply I should not trust the fps on emulators?

 On 7 July, 23:01, kevin0228ca kevin022...@gmail.com wrote:



  Hi everyone,
  I developed a game. On the emulator (not froyo) I am getting like less
  than 10 fps.
  But on my Nexus One with froyo I am getting 50 fps.
  Is this normal? Which one should I trust, I want my game to perform
  good on phones without froyo
  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: Notification Icon - One for Status and one for Pull Down List?

2010-07-02 Thread Kaj Bjurman
Correct. Just create a custom view, you can have whatever you want
there. E.g. an image and/or progress bar.

One thing that I however noted when I made my custom view was that the
view disappeared if I at runtime treid to hide one element in the
view. Don't know why. It looked like a bug. (I solved that problem by
creating two separate layouts)




On 2 Juli, 10:54, YuviDroid yuvidr...@gmail.com wrote:
 I don't have any handy code right now with me, but I'm quite sure you can do
 that by creating a custom view for the notification.
 I think I've seen an example for doing this on anddev.org.





 On Fri, Jul 2, 2010 at 8:56 AM, richie rich rich.al...@gmail.com wrote:
  Is it possible to show one icon in the status bar, but when the user
  pulls down the Notification List, to have a different icon display
  there? (ie, one for the Intent and one for the status bar?)

  Thanks,
  RIch

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

 --
 YuviDroidhttp://android.yuvalsharon.net

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


[android-developers] Re: How global is the app market?

2010-06-10 Thread Kaj Bjurman
I don't know why, where or how, but I know that my free Android app,
that I only have published on Android market has Chinese users, so
they must be able to see my app.



On 9 Juni, 20:27, Neilz neilhorn...@gmail.com wrote:
 Hi. I'm UK based and I'm wondering how much of the world can see and
 download my apps from the market?

 For example, the chinese market, which I believe is quite large, can
 they see UK or US based apps? Or does some kind of specific
 translation need to be done for this to happen? Or is it a separate
 market place?

 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 global is the app market?

2010-06-10 Thread Kaj Bjurman
What do you mean when you say that google closed their site. What
site?

I used gmail, google search and google reader when I visited China
last month (and I didn't use a proxy)


On 10 Juni, 13:12, Alex Xin xinxi...@gmail.com wrote:
 First of all, I'm a Chinese adn I want to tell you guys the truth about this
 fast growing market. I know that most of android powered phones sells in
 this market has no google market pre-installed in their device. In my Lenovo
 LePhone, which is a Android 1.6 based system, even has no google search
 built-in but with a baidu search instead. You may ask why, see Google's
 statement in the previous months, they have already closed their website in
 China. That's why we cannot see google market in some of phones.

 There's too many “illegal phones in China, I mean, they'r all smuggled to
 China. So some of Chines users could see google market in those phones and
 of course, buy apps there.



 On Thu, Jun 10, 2010 at 6:18 PM, Kaj Bjurman kaj.bjur...@gmail.com wrote:
  I don't know why, where or how, but I know that my free Android app,
  that I only have published on Android market has Chinese users, so
  they must be able to see my app.

  On 9 Juni, 20:27, Neilz neilhorn...@gmail.com wrote:
   Hi. I'm UK based and I'm wondering how much of the world can see and
   download my apps from the market?

   For example, the chinese market, which I believe is quite large, can
   they see UK or US based apps? Or does some kind of specific
   translation need to be done for this to happen? Or is it a separate
   market place?

   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.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: DrawableBitmap, Canvas and OR

2010-04-13 Thread Kaj Bjurman
It does also make sense for some color images. Take an image that only
has information in the red channel, and OR it with an image that only
has information in e.g. the blue channel and you'll see what I want to
do.



On 12 Apr, 21:38, Bob Kerns r...@acm.org wrote:
 And just what useful visual result do you want to happen as a result?

 OR makes sense for black and white, not for color.

 Or are you using the graphics processor for something other than
 actual graphics?

 On Apr 12, 3:30 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Hi,

  Is it in some way possible to draw something with bitwise OR? I.e. I
  want the pixel values to be OR:ed with the pixel values that already
  had been drawn.

  I could invoke get pixel, and use OR, and then set the pixel again,
  but that would be too slow.

  Thanks
  K

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

2010-04-12 Thread Kaj Bjurman
Hi,

Is it in some way possible to draw something with bitwise OR? I.e. I
want the pixel values to be OR:ed with the pixel values that already
had been drawn.

I could invoke get pixel, and use OR, and then set the pixel again,
but that would be too slow.

Thanks
K

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: How to use 3G Connection in Android Application instead of Wi-fi?

2010-03-25 Thread Kaj Bjurman
Why does it matter what connection you are using as long as you get a
connection? Just create a socket (or whatever it is that you have) and
let the OS decide how to connect.

Kaj


On 25 mar, 07:52, Jel jeyavel...@gmail.com wrote:
 Hi,

 How to use 3G Connection in Android Application instead of Wi-fi?

 i want to connect 3G connection , is there any sample code for get
 connect 3G instead of Wi-fi?

 Regards,
 Jeyavel N

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words REMOVE ME as the subject.


[android-developers] Re: Which API Level to target

2010-03-11 Thread Kaj Bjurman
Thanks for that link. Really appreciate it.

On 11 mar, 09:12, Dianne Hackborn hack...@android.com wrote:
 The most recent official version distribution (worldwide) is here:

 http://developer.android.com/resources/dashboard/platform-versions.html





 On Wed, Mar 10, 2010 at 11:47 PM, Kaj Bjurman kaj.bjur...@gmail.com wrote:
  Really nice to see some statistics, but I don't think that they are
  applicable for the rest of the world. It's e.g. not possible to buy
  any phones with Android 2.1 in many countries in europe, and it looks
  like your app mostly is used in US, where you have the Droid and the
  N1.

  I would expect the 1.5 pie to be much larger if you look at it
  globally.

  On 11 mar, 06:00, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
  wrote:
   Check out one of my app's companion site:

  http://www.radarnow.net

   Click on the stats link. You'll see the percentage for each version,
   also the devices that are being used. That may help make up your mind.

   -John Coryat

   Radar Now!

   What Zip Code?

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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

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

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


[android-developers] Re: currentTimeMillis() doesnt match on two concurrent emulators

2010-03-10 Thread Kaj Bjurman
Have you checked all entried in logcat to see if you can see anything
odd? I had e.g. a loop where each iteration did something like:

Log.i(TAG, Forecast expires at  +
aJavaDateInstanceRepresentingExpirationDateTime);

Each execution of that log statement took about 1-2 seconds since
date.toString() caused a resource bundle to be loaded by Android OS. I
can't understand why it is implemented like that, and isn't cached,
but I wasted about 10 seconds there.



On 11 mar, 05:01, Samsyn d...@synthetic-reality.com wrote:
 Thanks, Robert!

 yes, don't worry, I wasn't doing that.  :-)

 Basically the server has the master time, each client has a dynamic
 ping value to the server, which is also shared with the other clients
 for suitable adjustments.  at key moments a client notes the local
 currentMillis() value matching an important server time value,
 computes a delta which it can then use to move between currentMillis
 and server time as needed (until the next Important Event freshens the
 sync).

 Important Events occur frequently enough to keep the clients
 reasonably well synched, so long as I can depend on currentMillis to
 actually move forward in real time (i.e. 500 ms from now, I need it to
 be roughly 500 counts higher). Though a little jitter doesn't bother
 me, seeing it jump 10 SECONDS in a 2 second period was causing me
 alarm.

 I will, of course, fail if the client changes their clock setting in
 mid-game.  And I suppose the phone itself could initiate such a change
 based on some signal from the provider, but I tell myself it will only
 fail 'a little' in that case (assuming the hardware is not horribly
 defective), so I choose not to worry about that.  (knowing that I
 COULD use the nanotime to remove that sensitivity, but something makes
 me prefer currentMillis right now... some unproven suspicion that it
 is a cheaper computation.)

 And I assume what was happening before was that running multiple
 emulators under eclipse was starving them of cpu to such a degree that
 an internal emulation of the phone clock was missing some important
 polled event.  I can't decide if I think that's cool or not.  Would it
 be cheating for the emulator to just read the host hardware clock?...
 I guess so.  So instead it probably reads a simulation of the
 nanoclock, which turns out to be unreliable in a low cpu cycle
 environment.

 And manually running emulators in separate CMD windows seems to help
 it take advantage of the host's multiple cores.  Which I guess would
 be asking Eclipse a lot to do, given that it is also giving me all
 those nice debug hooks :-)  I shouldn't be so demanding.  I love you,
 Eclipse, I really do, except when you crash or that time you deleted
 every source file in my project with nary a warning.

 Thanks again!

 - Dan

 On Mar 10, 5:53 pm, Robert Green rbgrn@gmail.com wrote:



  Samsyn,

  For multiplayer synchronization, you absolutely can not count on the
  current time of either device.  Here's one way to handle it:

  Both host and client use System.nanoTime() / 100;  That gives you
  a fairly accurate counter to use.
  Host sends snapshots with their current time.  Client adapts the
  host's time for interpolation by attempting to detect ping and use it
  as a skew.

  On Mar 10, 7:36 pm, Samsyn d...@synthetic-reality.com wrote:
  =

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

2010-03-10 Thread Kaj Bjurman
I don't think that that is totally correct. You can handle multiple
screen sizes, and still make the app work on 1.5. The new entries in
the manifest will be ignored by 1.5, so you are safe as long as you
don't use any new APIs/methods.



On 11 mar, 05:46, Kumar Bibek coomar@gmail.com wrote:
 Targetting 1.5 would be the safest. But, you can gradually shift to
 1.6 when the next SDK comes out.

 But again, it depends on your app. If you are using some things that
 are only available on 16 and up, you do not have a choice. And also,
 if you have taken care of multiple screen sizes, which is a feature in
 1.6 and up, you cannot compile your code for 1.5.

 Thanks and Regards,
 Kumar Bibek.

 On Mar 11, 9:43 am, jb cona...@gmail.com wrote:



  Hi,

  Very basic, newbie question. I'm new to the Android world. I'm nearing
  completion of a port of my iPhone app to Android. The uncertainty I
  have is what API Level to target. I've only tested on the emulator at
  2.1 and 1.6.

  Any suggestions, ideas, things to consider?

  TIA,

  jb

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


[android-developers] Re: Which API Level to target

2010-03-10 Thread Kaj Bjurman
Really nice to see some statistics, but I don't think that they are
applicable for the rest of the world. It's e.g. not possible to buy
any phones with Android 2.1 in many countries in europe, and it looks
like your app mostly is used in US, where you have the Droid and the
N1.

I would expect the 1.5 pie to be much larger if you look at it
globally.



On 11 mar, 06:00, Maps.Huge.Info (Maps API Guru) cor...@gmail.com
wrote:
 Check out one of my app's companion site:

 http://www.radarnow.net

 Click on the stats link. You'll see the percentage for each version,
 also the devices that are being used. That may help make up your mind.

 -John Coryat

 Radar Now!

 What Zip Code?

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


[android-developers] Re: Android Device Seeding Program - Differences in phone for developers?

2010-03-09 Thread Kaj Bjurman
Is there a reason to why you expect it to be different from the one
that you can order?



On 9 mar, 13:19, nickthecook nickthec...@gmail.com wrote:
 Does anyone know if the Nexus One that Google is sending developers as
 part of the Device Seeding Program is different from the ones people
 get when they order them from Google's website?

 Different packaging? Different firmware? Different pattern on the
 case?

 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: Android Device Seeding Program - Differences in phone for developers?

2010-03-09 Thread Kaj Bjurman
Why? I visited a Google Technology Usergroup meeting where Google
handed out Nexus phones to all visitors, and they were identical to
the one that I had ordered from their online store.


On 9 mar, 15:10, mscwd01 mscw...@gmail.com wrote:
 I'd be suprised if it didn't have some kind of Device Seeding
 inscription on the back of the Nexus, but apart from that it's in
 their interest to make it no different to the device the paying public
 can buy.

 On Mar 9, 12:19 pm, nickthecook nickthec...@gmail.com wrote:



  Does anyone know if the Nexus One that Google is sending developers as
  part of the Device Seeding Program is different from the ones people
  get when they order them from Google's website?

  Different packaging? Different firmware? Different pattern on the
  case?

  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: Which is the bestAndroid Devs Device?

2010-03-07 Thread Kaj Bjurman
I don't see how that is related to buying a device.

@Op. The correct answer is probably to buy a developer phone, and
probably the developer phone 2 (Which is an HTC Magic if I recall it
correctly).
The developer phone is however not state of the art, and it's hard to
upgrade it to Android 2.1.

I don't know what versions you are interested in, and what resolutions
you want to support. I'm testing on a Magic and a Nexus One. Works
great.




On 8 mar, 07:52, Maxood maqs...@salsoft.net wrote:
 On Mar 5, 3:55 am, Jalal jalalso...@gmail.com wrote:

  Hello everyone,

  I'm developing an Android application in my school department. We are
  interested in purchasing a Developer Device to have more testing
  capabilities than the Android emulatior has offer. Which one supports
  the largest amount of platforms? Which one is faster, more reliable?.
  What should I be looking for?

  If you could give me some info about this or tell me some of your
  developing-on-device experiences I would really appreciated. Thanks in
  advance.

  Regards,
  Jalal

 This is what i'm looking into as well. So far what i have found is
 Device Anywherewww.deviceanywhere.com. Haven't really looked into
 it though. Please do let me know once you have a satisfactory answer
 to your question.

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


[android-developers] Re: What does the prefix 'm' stand for ?

2010-02-23 Thread Kaj Bjurman
I don't buy that argument since since all of the core classes in Java
are written without prefixes of any kind, and many of the classes were
implemented before IDEs became popular. I do also think that the
convention would have been added to the Code Conventions for the Java
Programming Language (http://java.sun.com/docs/codeconv/html/
CodeConvTOC.doc.html) if Sun thought that it added some great value.

One thing that I have observed (it could be 100% wrong, but it's based
on reading Java code since the language was released in 1996) is that
most people who think they need prefixes and odd conventions write too
long methods, or too complex logic, and often in combination with
classes that are doing more than one thing. There's not need of
prefixing if your methods are short and easy to read (IMHO).



On 22 Feb, 17:05, Romain Guy romain...@android.com wrote:
 I myself am not fond of prefixes, especially since languages like Java
 already have this. when you need to distinguish local vars vs
 members. Also, modern IDEs highlight fields differently from local
 variables.

 It does make sense however on a project like Android where not
 everybody is necessarily using an IDE. And it's just a coding
 convention :)





 On Sun, Feb 21, 2010 at 10:20 PM, Frank Weiss fewe...@gmail.com wrote:
  I'm one of those guys who think scope prefixes, like m, are more trouble
  than they're worth. The fact that you had to explain it to a newbie makes me
  smile.

  On Sun, Feb 21, 2010 at 10:04 PM, Romain Guy romain...@android.com wrote:

  It stands for member. I believe the use of an m prefix with MFC
  has nothing to do with the name MFC either, but rather to identify
  variables that are class members as opposed to local variables for
  instance.

  On Sun, Feb 21, 2010 at 9:52 PM, Christ wutie...@gmail.com wrote:
   Hi guys,

   I saw many sample codes that each variable contains the 'm' prefix. I
   don't know what this m means.
   I have two-year experience in MFC. Each variable has 'm' prefix to
   tell you that I'm the one variable of MFC component. (m stands for
   MFC).
   So...can anybody answer me this question?

   Regards,
   Christ

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

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

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

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

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

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

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

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


[android-developers] Re: question about handle and runnables

2010-02-23 Thread Kaj Bjurman
No, that isn't the problem.


On 23 Feb, 09:24, Néstor Pavón Puro nespap...@yahoo.es wrote:
 Maybe because the second option is not to much time displayed? Put more time 
 between the second and the third option.

 --- El mar, 23/2/10, Michael Lam mmingfei...@gmail.com escribió:

 De: Michael Lam mmingfei...@gmail.com
 Asunto: [android-developers] question about handle and runnables
 Para: Android Developers android-developers@googlegroups.com
 Fecha: martes, 23 de febrero, 2010 06:58

 hi,

 i am using handle and runnables to switch/change the content of the
 TextView using a timer. for some reason, when running, the app
 always skips the second step (Step Two: fry egg), and only show the
 last (third) step (Step three: serve egg).

 TextView t;
     private String sText;

     private Handler mHandler = new Handler();

     private Runnable mWaitRunnable = new Runnable() {
         public void run() {
             t.setText(sText);
         }
     };

     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         setContentView(R.layout.main);

         mMonster = BitmapFactory.decodeResource(getResources(),
                 R.drawable.monster1);

         t=new TextView(this);
         t=(TextView)findViewById(R.id.TextView01);

         sText = Step One: unpack egg;
         t.setText(sText);

         sText = Step Two: fry egg;
         mHandler.postDelayed(mWaitRunnable, 3000);

         sText = Step three: serve egg;
         mHandler.postDelayed(mWaitRunnable, 4000);
         ...

 }

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email 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: Remote Test your apps on real phones with Sony Ericsson Perfecto Mobile

2010-02-23 Thread Kaj Bjurman
What's the relation to Android?

On 23 Feb, 10:47, SonyEricsson DeveloperWorld
sonyericssondeveloperwo...@gmail.com wrote:
 Perfecto mobile is a remote device testing from Sony Ericsson that
 enables you to be sure that your application works on a real device
 even though you don’t have it in your hand.

 The Perfecto Mobile service enables you to

     * Test on a range of real Sony Ericsson handsets via the Internet
     * Test on pre-launched Sony Ericsson phones
     * Remotely access various mobile networks and geographies.
     * Showcase your application with snapshots and video clips
     * Run automated tests across multiple handsets

 More information is available athttp://bit.ly/coUR5D

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

2010-02-23 Thread Kaj Bjurman
He created them where he declared them.


On 23 Feb, 14:34, niko20 nikolatesl...@yahoo.com wrote:
 Hi,

 I'm not seeing any code where you are creating a new handler to use

 You need a mHandler = new Handler(); in your OnCreate routine BEFORE
 you use it.

 -niko

 On Feb 23, 2:50 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  No, that isn't the problem.

  On 23 Feb, 09:24, Néstor Pavón Puro nespap...@yahoo.es wrote:

   Maybe because the second option is not to much time displayed? Put more 
   time between the second and the third option.

   --- El mar, 23/2/10, Michael Lam mmingfei...@gmail.com escribió:

   De: Michael Lam mmingfei...@gmail.com
   Asunto: [android-developers] question about handle and runnables
   Para: Android Developers android-developers@googlegroups.com
   Fecha: martes, 23 de febrero, 2010 06:58

   hi,

   i am using handle and runnables to switch/change the content of the
   TextView using a timer. for some reason, when running, the app
   always skips the second step (Step Two: fry egg), and only show the
   last (third) step (Step three: serve egg).

   TextView t;
       private String sText;

       private Handler mHandler = new Handler();

       private Runnable mWaitRunnable = new Runnable() {
           public void run() {
               t.setText(sText);
           }
       };

       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);

           setContentView(R.layout.main);

           mMonster = BitmapFactory.decodeResource(getResources(),
                   R.drawable.monster1);

           t=new TextView(this);
           t=(TextView)findViewById(R.id.TextView01);

           sText = Step One: unpack egg;
           t.setText(sText);

           sText = Step Two: fry egg;
           mHandler.postDelayed(mWaitRunnable, 3000);

           sText = Step three: serve egg;
           mHandler.postDelayed(mWaitRunnable, 4000);
           ...

   }

   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email 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: question about handle and runnables

2010-02-22 Thread Kaj Bjurman
That's because you change sText before it has been displayed, so the
sText is Step three: serve egg when mWaitRunnable is executed after
3 seconds.



On 23 Feb, 06:58, Michael Lam mmingfei...@gmail.com wrote:
 hi,

 i am using handle and runnables to switch/change the content of the
 TextView using a timer. for some reason, when running, the app
 always skips the second step (Step Two: fry egg), and only show the
 last (third) step (Step three: serve egg).

 TextView t;
         private String sText;

         private Handler mHandler = new Handler();

         private Runnable mWaitRunnable = new Runnable() {
         public void run() {
                 t.setText(sText);
         }
     };

         @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);

         setContentView(R.layout.main);

         mMonster = BitmapFactory.decodeResource(getResources(),
                         R.drawable.monster1);

         t=new TextView(this);
                 t=(TextView)findViewById(R.id.TextView01);

                 sText = Step One: unpack egg;
                 t.setText(sText);

                 sText = Step Two: fry egg;
                 mHandler.postDelayed(mWaitRunnable, 3000);

                 sText = Step three: serve egg;
                 mHandler.postDelayed(mWaitRunnable, 4000);
                 ...



 }

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

2010-02-09 Thread Kaj Bjurman
Great to hear that you are looking into this. :)


On 9 Feb, 09:06, Dianne Hackborn hack...@android.com wrote:
 Actually the resource table (which includes all strings) is not stored
 compressed, so it can be mmapped.  Worse, the strings are stored as UTF-16.
  (I know, I know, that was dumb.  I am ashamed.)

 Bloated apps as the number of localizations increase is definitely an issue
 (look at Maps as an example), which we will hopefully be addressing this
 year.





 On Mon, Feb 8, 2010 at 2:00 PM, Mark Murphy mmur...@commonsware.com wrote:
   Is it possible to have an external strings.xml or something like that?
   I'd like to translate my application into several different languages,
   but the apk would become to large if I include all languages. I would
   instead like to be able to load languages on demand (from an external
   url) and store them on the sdcard.

   Is that possible in any way? How could I in that case use the new
   language?

  The built-in resource system cannot use language files outside the APK.
  That doesn't prevent you from rolling your own system, though.

  Also, bear in mind that string resources are going to be compressed in the
  APK file, so unless you have some insane number of strings (tens of
  thousands), or lots of really long strings, I wouldn't expect size of the
  APK to be a big concern.

  --
  Mark Murphy (a Commons Guy)
 http://commonsware.com
  Android App Developer Books:http://commonsware.com/books.html

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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

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

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


[android-developers] External strings.xml?

2010-02-08 Thread Kaj Bjurman
Hi,

Is it possible to have an external strings.xml or something like that?
I'd like to translate my application into several different languages,
but the apk would become to large if I include all languages. I would
instead like to be able to load languages on demand (from an external
url) and store them on the sdcard.

Is that possible in any way? How could I in that case use the new
language?

Kaj

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

2010-02-08 Thread Kaj Bjurman
Thanks,

Just what I thought. I will currently only support 4 languages, but
the size of the apk is almost 400 kB already, and that's with only one
language. Just wanted to try and keep the apk as small as possible. I
will however include the other languages in the APK since they only
will add something like 50 kB (or less I hope).


On 8 Feb, 23:00, Mark Murphy mmur...@commonsware.com wrote:
  Is it possible to have an external strings.xml or something like that?
  I'd like to translate my application into several different languages,
  but the apk would become to large if I include all languages. I would
  instead like to be able to load languages on demand (from an external
  url) and store them on the sdcard.

  Is that possible in any way? How could I in that case use the new
  language?

 The built-in resource system cannot use language files outside the APK.
 That doesn't prevent you from rolling your own system, though.

 Also, bear in mind that string resources are going to be compressed in the
 APK file, so unless you have some insane number of strings (tens of
 thousands), or lots of really long strings, I wouldn't expect size of the
 APK to be a big concern.

 --
 Mark Murphy (a Commons Guy)http://commonsware.com
 Android App Developer Books:http://commonsware.com/books.html

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


[android-developers] Re: HTTP Requests - can Android be identified?

2010-01-12 Thread Kaj Bjurman
It depends on what you mean. An application that opens an
URLConnection can say that it is something different, e.g. an IE
browser.

You can find an example here:
http://www.java2s.com/Code/Java/Network-Protocol/URLConnectionsetRequestProperty.htm


On 12 Jan, 12:40, Neilz neilhorn...@googlemail.com wrote:
 I presume there's no way to mask the android request to make it appear
 like another :-/

 On Jan 12, 11:29 am, Neilz neilhorn...@googlemail.com wrote:



  Right, so if someone wanted to stop web responses going to android
  apps, they can, without it affecting their usual service?

  Thanks.

  On Jan 12, 10:28 am, Adrian Vintu adrianvi...@gmail.com wrote:

   Sure. You have to use the user agent.

   You have something like

   Mozilla/5.0 (Linux; U; Android 1.5; en-us; Galaxy Build/CUPCAKE)
   AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile 
   Safari/525.20.1

   for Android

   and something like

   Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102
   Firefox/3.5.5 (.NET CLR 3.5.30729)

   from the normal Firefox browser.

   BR,
   Adrian Vintu

   On Tue, Jan 12, 2010 at 11:21 AM, Neilz neilhorn...@googlemail.com 
   wrote:
Hi all.

Could a standard web server identify an HTTP request as coming from a
normal browser, as opposed to an Android application?

What could be different about the request that would enable the server
to differentiate between the two, and modify the response accordingly?

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
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: what is a suitable upper limit for application size?

2010-01-08 Thread Kaj Bjurman
25% Don't you think that that is too much? Most users install more
than 4-5 applications. I would never ever install an application that
is that large.

I do however agree with the others who says that it's ok if you
download the images dynamically, and stores it on the sdcard. That's
how my application handles different skins.


On 8 Jan, 03:56, ian stilbit...@gmail.com wrote:
 The tourism related app I am completing has about 250 images for a
 total of maybe 15MB.

 I;d like to add another 100 or so images but sometimes I get an
 'Insufficient storage' error message and have to restart the emulator.
 That in itself isn't so bad a problem but now I'm wondering about
 practical limits for real devices.

 Anybody know large can I make my app assuming I wouldn't want to to
 use up more than perhaps 25% of a user's discretionary storage?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: AppWidget changes id after reboot

2010-01-01 Thread Kaj Bjurman
I just found this thread that also confirms that it's a Sprint Hero
bug:

http://groups.google.com/group/android-developers/browse_thread/thread/554f72f397a8539f/722034a5aca418c6?lnk=gstq=AppWidget#722034a5aca418c6



On 31 Dec 2009, 23:37, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 Hi,

 I have a strange problem, on a few devices. I have developed anAppWidget, and 
 it uses a database to store the configuration for each
 instance of the widget. The widget id is the key in the database.

 Everything works on most devices, but I got a bug report a couple of
 days ago. A user said that the widget never worked after reboot. The
 user who was very helpful sent me a log from his phone, and I could
 then see that the widget got a new id each time he did a reboot.

 The log says this about his device (A Sprint Hero in US):

 Device model: HERO200
 Firmware version: 1.5
 Kernel version: 2.6.27-533ce29d
 htc-ker...@and18-2 )
 #742 PREEMPT Fri Aug 28 21:59:31 CST 2009
 Build number: 1.56.651.2

 He can reproduce the problem on his friends device as well, but I have
 never seen the problem with HTC Hero/Magic here in Europe.

 Something about the code. onUpdate in my widget class gets invoked
 after reboot. The integer array with widget id:s does e.g say that
 only one widget exists, and that it has id 5.

 I then try to execute:

 AppWidgetProviderInfo info = appWidgetManager.getAppWidgetInfo
 (widgetId);

 and get null back, so I query for all ids:

 int[] ids = appWidgetManager.getAppWidgetIds(new ComponentName
 (PACKAGE_NAME, className));

 and get back an array that says that a widget with id 6 exists. (The
 new id is always 1 larger than before reboot)

 What to do? Is this a known bug?

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


[android-developers] Re: What is the Sprint Hero AppWidget problem?

2010-01-01 Thread Kaj Bjurman
Did you find a workaround?



On 4 Nov 2009, 06:20, btm...@gmail.com btm...@gmail.com wrote:
 Hello all,

 I wrote a widget that has been working fine for most folks. However, I
 started getting bug reports about how the widget would be blank on
 reboot (not receive an update?), and it seemed that the Sprint Hero
 continually came up. I thought I was crazy but I'm finding that other
 people are having the same problems:

 Searching Google for sprint heroappwidgetproblems yields:

 Added warning about the problem on the Sprint Hero device: On the
 Sprint Hero (HTC ROM v1.29.xxx) theAppWidgetAPI is broken in such a
 way that it won't ...

 More specific blog post that mentions it but doesn't explain the
 problem:

 http://koxx3.wordpress.com/2009/10/22/htc-hero-sprint-bug/

 I found the reason : HTC changed the Android widget management at
 startup !
 I hope they will fix it in a new ROM release, but I’d like to find a
 solution to bypass this problem.
 EDIT 28/10/2009 : problem solve for ‘Pure calendar’ with new option.

 I e-mailed the author in hopes of getting an answer, but I haven't
 received any response. Does anybody with a Sprint Hero know what the
 problem is?

 Thank you,
 -Brian

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

2009-12-31 Thread Kaj Bjurman
Hi,

I have a strange problem, on a few devices. I have developed an
AppWidget, and it uses a database to store the configuration for each
instance of the widget. The widget id is the key in the database.

Everything works on most devices, but I got a bug report a couple of
days ago. A user said that the widget never worked after reboot. The
user who was very helpful sent me a log from his phone, and I could
then see that the widget got a new id each time he did a reboot.

The log says this about his device (A Sprint Hero in US):

Device model: HERO200
Firmware version: 1.5
Kernel version: 2.6.27-533ce29d
htc-ker...@and18-2 )
#742 PREEMPT Fri Aug 28 21:59:31 CST 2009
Build number: 1.56.651.2

He can reproduce the problem on his friends device as well, but I have
never seen the problem with HTC Hero/Magic here in Europe.

Something about the code. onUpdate in my widget class gets invoked
after reboot. The integer array with widget id:s does e.g say that
only one widget exists, and that it has id 5.

I then try to execute:

AppWidgetProviderInfo info = appWidgetManager.getAppWidgetInfo
(widgetId);

and get null back, so I query for all ids:

int[] ids = appWidgetManager.getAppWidgetIds(new ComponentName
(PACKAGE_NAME, className));

and get back an array that says that a widget with id 6 exists. (The
new id is always 1 larger than before reboot)


What to do? Is this a known bug?




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


[android-developers] URLconnection.setConnectTimeout doesn't work?

2009-12-11 Thread Kaj Bjurman
Hi,

I have code that is reading data from a website, the website that I'm
reading data from is at times a bit slows, so I want to use
setConnectTimeout on the URLconnection that I'm using.

The problem is that it looks like the value is ignored, or that it
doesn't work. I have set the setConnectTimeout to 30 seconds (i.e.
3 as value since the javadoc says that the argument is in ms).

I then call connect, and I have through my logs seen that the code can
get blocked in the connect call for several hours (in Android 1.6,
don't know about the other versions).

Has anyone else seen this problem? What to do about it? I don't see
how I would create a workaround since I don't have anything that I can
invoke close on (I would create a separate thread that invoked close
on the stream/socket after a certain time if the problem was related
to slow reading)

Thanks
Kaj


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

2009-12-11 Thread Kaj Bjurman
I think I've seen something similar to that on the Droid. I got it
when I invoked updateConfiguration with a new locale without
specifying android:configChanges=locale in the activity section in
the AndroidManifest.

(The same code worked in 1.5 and 1.6 without any errors)



On 11 Dec, 17:49, stanlick stanl...@gmail.com wrote:
 Can someone who speaks better droid than me please help to translate
 this beauty?

 12-11 09:19:51.879: ERROR/WindowManager(232): Activity
 com.androidologist.friendfinder.MainActivity has leaked window
 com.android.internal.policy.impl.phonewindow$decorv...@43db25f0 that
 was originally added here

 Peace,
 Scott

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

2009-12-11 Thread Kaj Bjurman
dip and dp is the same according to the documentation.

dp
Density-independent Pixels - an abstract unit that is based on the
physical density of the screen. These units are relative to a 160 dpi
screen, so one dp is one pixel on a 160 dpi screen. The ratio of dp-to-
pixel will change with the screen density, but not necessarily in
direct proportion. Note: The compiler accepts both dip and dp,
though dp is more consistent with sp.



On 10 Dec, 14:00, 吴祥辉 wuxiang...@gmail.com wrote:
    android:minWidth=294dp
    android:minHeight=72dp

 Did U check this ? dp = dip.

 2009/12/10 Paul Turchenko paul.turche...@gmail.com





  +1

  On Dec 8, 1:18 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:
   Doesn't anyone got input on this issue? Isn't it possible to solve the
   problem?

   On 6 Dec, 19:50, Kaj Bjurman kaj.bjur...@gmail.com wrote:

I tried to create a folder named xml-small and placed the widget
provider xml-files there.

It looks like I need to use something like 50x50 dip for one cell on
the DSTL1, so 100x50 dip is 2x1, and 200x50 dip is 4x1 but that does
only work on the DSTL1. The HTC Tattoo which also is considered xml-
small displays a 3x1 widget if I use 200x50 dip :(

240x50 dip works as 4x1 on HTC Tattoo

On 6 Dec, 19:09, Kaj Bjurman kaj.bjur...@gmail.com wrote:

 Hi,

 I got some problems when specifying the size of my AppWidget / Home
 screen widget. The widget is currently available in the sizes 1x1,
  2x1
 and 4x1 if we count in cells.

 Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
 and Motorola Droid (480 x 854), but I do have problems on the DSTL1
 (240x400).

 I have specified the sizes according to the description here:
 http://android-developers.blogspot.com/2009/04/introducing-home-scree...

 Below is what I got in my xml-files.

 The problem on the DSTL1 is that it says that the 4x1 widget is too
 large to be placed on the home screen. The 2x1 widget looks like it
  is
 3x2, and the 1x1 widget looks like 2x2.

 What should I do? What's wrong?

 !-- small, 1x1 --

 appwidget-provider xmlns:android=
 http://schemas.android.com/apk/res/
 android
     android:minWidth=72dip
     android:minHeight=72dip
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

 !-- medium, 2x1 --

 appwidget-provider xmlns:android=
 http://schemas.android.com/apk/res/
 android
     android:minWidth=146dip
     android:minHeight=72dip
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

 !-- large, 4x1 --

 appwidget-provider xmlns:android=
 http://schemas.android.com/apk/res/
 android
     android:minWidth=294dp
     android:minHeight=72dp
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

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

 --
 thanks a lot

 =
 ||  Wu xiang hui                          ||
 ||  Msn: wuxiang...@google.com ||
 =

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


[android-developers] Re: URLconnection.setConnectTimeout doesn't work?

2009-12-11 Thread Kaj Bjurman
Thanks for the answer, but I found out why I saw the strange
behaviour.

The code was invoked by a Service that hadn't acquired a WakeLock.
Acquiring a WakeLock (PowerManager.PARTIAL_WAKE_LOCK) solved the
problem with setConnectTimeout behaving in a strange way.

One thing that still is odd is that the first connection attempt
always get a timeout. I then try to a connect again, and that one
succeeds.

Does anyone know what might cause this?




On 11 Dec, 17:44, Jeffrey Blattman jeffrey.blatt...@gmail.com wrote:
 you can try doing the same thing w/ the httpclient classes. i know that
 doesn't answer your question but it's something else to try.

 On 12/11/09 3:53 AM, Kaj Bjurman wrote:





  Hi,

  I have code that is reading data from a website, the website that I'm
  reading data from is at times a bit slows, so I want to use
  setConnectTimeout on the URLconnection that I'm using.

  The problem is that it looks like the value is ignored, or that it
  doesn't work. I have set the setConnectTimeout to 30 seconds (i.e.
  3 as value since the javadoc says that the argument is in ms).

  I then call connect, and I have through my logs seen that the code can
  get blocked in the connect call for several hours (in Android 1.6,
  don't know about the other versions).

  Has anyone else seen this problem? What to do about it? I don't see
  how I would create a workaround since I don't have anything that I can
  invoke close on (I would create a separate thread that invoked close
  on the stream/socket after a certain time if the problem was related
  to slow reading)

  Thanks
  Kaj

 --

  qr-gmail.png
  1KVisaHämta

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

2009-12-08 Thread Kaj Bjurman
Doesn't anyone got input on this issue? Isn't it possible to solve the
problem?


On 6 Dec, 19:50, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 I tried to create a folder named xml-small and placed the widget
 provider xml-files there.

 It looks like I need to use something like 50x50 dip for one cell on
 the DSTL1, so 100x50 dip is 2x1, and 200x50 dip is 4x1 but that does
 only work on the DSTL1. The HTC Tattoo which also is considered xml-
 small displays a 3x1 widget if I use 200x50 dip :(

 240x50 dip works as 4x1 on HTC Tattoo

 On 6 Dec, 19:09, Kaj Bjurman kaj.bjur...@gmail.com wrote:

  Hi,

  I got some problems when specifying the size of my AppWidget / Home
  screen widget. The widget is currently available in the sizes 1x1, 2x1
  and 4x1 if we count in cells.

  Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
  and Motorola Droid (480 x 854), but I do have problems on the DSTL1
  (240x400).

  I have specified the sizes according to the description 
  here:http://android-developers.blogspot.com/2009/04/introducing-home-scree...

  Below is what I got in my xml-files.

  The problem on the DSTL1 is that it says that the 4x1 widget is too
  large to be placed on the home screen. The 2x1 widget looks like it is
  3x2, and the 1x1 widget looks like 2x2.

  What should I do? What's wrong?

  !-- small, 1x1 --

  appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
  android
      android:minWidth=72dip
      android:minHeight=72dip
      android:updatePeriodMillis=0
      android:initialLayout=@layout/widget_configure/

  !-- medium, 2x1 --

  appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
  android
      android:minWidth=146dip
      android:minHeight=72dip
      android:updatePeriodMillis=0
      android:initialLayout=@layout/widget_configure/

  !-- large, 4x1 --

  appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
  android
      android:minWidth=294dp
      android:minHeight=72dp
      android:updatePeriodMillis=0
      android:initialLayout=@layout/widget_configure/

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

2009-12-06 Thread Kaj Bjurman
Hi,

I got some problems when specifying the size of my AppWidget / Home
screen widget. The widget is currently available in the sizes 1x1, 2x1
and 4x1 if we count in cells.

Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
and Motorola Droid (480 x 854), but I do have problems on the DSTL1
(240x400).

I have specified the sizes according to the description here:
http://android-developers.blogspot.com/2009/04/introducing-home-screen-widgets-and.html

Below is what I got in my xml-files.

The problem on the DSTL1 is that it says that the 4x1 widget is too
large to be placed on the home screen. The 2x1 widget looks like it is
3x2, and the 1x1 widget looks like 2x2.

What should I do? What's wrong?




!-- small, 1x1 --

appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
android
android:minWidth=72dip
android:minHeight=72dip
android:updatePeriodMillis=0
android:initialLayout=@layout/widget_configure/

!-- medium, 2x1 --

appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
android
android:minWidth=146dip
android:minHeight=72dip
android:updatePeriodMillis=0
android:initialLayout=@layout/widget_configure/

!-- large, 4x1 --

appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
android
android:minWidth=294dp
android:minHeight=72dp
android:updatePeriodMillis=0
android:initialLayout=@layout/widget_configure/

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

2009-12-06 Thread Kaj Bjurman
I tried to create a folder named xml-small and placed the widget
provider xml-files there.

It looks like I need to use something like 50x50 dip for one cell on
the DSTL1, so 100x50 dip is 2x1, and 200x50 dip is 4x1 but that does
only work on the DSTL1. The HTC Tattoo which also is considered xml-
small displays a 3x1 widget if I use 200x50 dip :(

240x50 dip works as 4x1 on HTC Tattoo


On 6 Dec, 19:09, Kaj Bjurman kaj.bjur...@gmail.com wrote:
 Hi,

 I got some problems when specifying the size of my AppWidget / Home
 screen widget. The widget is currently available in the sizes 1x1, 2x1
 and 4x1 if we count in cells.

 Everything works in E.g. HTC Tattoo (240 x 320), HTC Magic (320x480)
 and Motorola Droid (480 x 854), but I do have problems on the DSTL1
 (240x400).

 I have specified the sizes according to the description 
 here:http://android-developers.blogspot.com/2009/04/introducing-home-scree...

 Below is what I got in my xml-files.

 The problem on the DSTL1 is that it says that the 4x1 widget is too
 large to be placed on the home screen. The 2x1 widget looks like it is
 3x2, and the 1x1 widget looks like 2x2.

 What should I do? What's wrong?

 !-- small, 1x1 --

 appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
 android
     android:minWidth=72dip
     android:minHeight=72dip
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

 !-- medium, 2x1 --

 appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
 android
     android:minWidth=146dip
     android:minHeight=72dip
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

 !-- large, 4x1 --

 appwidget-provider xmlns:android=http://schemas.android.com/apk/res/
 android
     android:minWidth=294dp
     android:minHeight=72dp
     android:updatePeriodMillis=0
     android:initialLayout=@layout/widget_configure/

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


[android-developers] Re: Android Market Anti-Piracy

2009-11-24 Thread Kaj Bjurman
Huh? Regarding (1). That's almost the same as normal pc applications
that require online activation. They either get cracked, someone
creates a serial number generator, or people start posting stolen
activation codes.



On 24 Nov, 11:15, Dmitry.Skiba dmitry.sk...@gmail.com wrote:
 Nice discussion you have there...

 For the last few days I was thinking about how to implement protection
 technics for Android apps.

 One way is to go with alternative markets (like slideme) which provide
 online activation (slidelock in case of slideme).

 But more challenging (and interesting!) is to integrate protection
 with android's own market.
 I can think of three schemes:
 (1) Be able to supply an unique token to the user when he buys an app,
 and have him enter that token later in the app to activate it.
 (2) Somehow know which (by some id) phone is buying, and generate an
 app that will run only on that particular phone.
 (3) Generate an unique apk for each purchase and then let user through
 activation process which will tie an unique app id to the unique phone
 id.
 All this methods assume that app is protected (the interesting part)
 and can't be easily cracked.

 Now, as I understand options (2) and (3) is not available. We don't
 know anything about buying phone nor can we generate an apks.
 What about (1)? [I'm asking because I know nothing about commercial
 aspect of the market.]
 Or maybe there are other options? Let's discuss!

 Dmitry

 On 16 ноя, 17:12, AlexK kucherenko.a...@gmail.com wrote:



  Our company starts today anti-piracy initiative against piracy that
  already happened onAndroidMarket. We request all vendors and
  developers to support this initiative.

  Piracy become a threat for vendors that publishing application 
  onAndroidMarket! It is not a joke, it is a real threat.

  Our last application publishing shows how bad is situation on 
  theAndroidMarket. Only 20% of all installs are legal, other 80% are in
  piracy hands.

  Google does not provide any actions to stop piracy, so we as a vendor
  that provide software forAndroidMarket, have to think about
  protection measures. Piracy is threat that cannot be target easily and
  eliminated in one day. Only join of all vendors can help in anti-
  piracy.

  ArtfulBits company decide to start from today AndroidAnti-piracy
  Movement with main goal: protect vendors and punish piracy.

  Our next steps are:
  - Petition to Google with request to provide better anti-piracy
  protocols forAndroidMarket;
  - Collective anti-Google charge, from side of vendors that loose money
  due to Google security holes inAndroidMarketapplication
  distribution channel;
  - Public web service Black List, that helps all developer to check
  is there application installed on pirate phone;
  - Joining of the software vendors over that problem for finding better
  anti-piracy strategies;
  - Identification of the roots of piracy, that make 
  possibleAndroidMarketsoftware leaking and contribution them to justice.

  A little later today we will open black-list database of devices,
  where was installed stolen version of applications. In addition, we
  will provide easy code for all developers that can be integrated
  into own application and during first start, check is phone in black
  list or not.

  Opened Anti-Piracy forum thread:http://www.artfulbits.com/Support
  Petition can be signed 
  here:http://www.petitionspot.com/petitions/androidpiracy

  Stay tuned! 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: Android Market Anti-Piracy

2009-11-20 Thread Kaj Bjurman
That does of course depend on in which country you do it. You wouldn't
be allowed to do it in Sweden, and you could be sued there.



On 19 Nov, 18:51, LambergaR martin.s...@gmail.com wrote:
 Which law do you break by gathering personal data without informing
 the user?

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


[android-developers] Re: Android Market Anti-Piracy

2009-11-20 Thread Kaj Bjurman
You might be allowed to store personal data in some countires if you
first ask a supervisory authority if you can do so. That is what e.g.
banks are doing.


On 20 Nov, 15:29, AlexK kucherenko.a...@gmail.com wrote:
 ok... I got your point.

 Maybe you know how it's possible to have shared database of user
 history between loan companies?

 My point is: everywhere where involved money give you possibility to
 collect personal data and use it for own customers protection. of
 course that does not mean that you can publish that information
 everywhere.

 In my cases returned only device piracy threat level which make
 improssible to identify who is the customer, what exectly he/she do to
 get that status... Sources are not opened - user privacy is
 protected.

 So what you afraid?! That some one knows more then telling?! That
 someone add additional risk for piracy?!

 On Nov 20, 3:53 pm, LambergaR martin.s...@gmail.com wrote:



  You can report the user to some sort of LEGAL authority and they can
  get and process users data. You (as a person that is not an law
  officer) are not allowed to store and process any personal data
  without my explicit permission.

  So, you can report the user to police but if you are using any data
  gathered in illegal way your complaint is not valid.
  Privacy is a very problematic issue - and it should be that way!

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


[android-developers] Re: Android Market Anti-Piracy

2009-11-19 Thread Kaj Bjurman
Do they really expect people to manually report each phone?


On 19 Nov, 12:09, Paul Turchenko paul.turche...@gmail.com wrote:
 Guess they are gathering data from different application vendors. As
 far as I can tell, they will tell that device is 100% blacklisted only
 if 2 of 3 application vendors have reported that particular IMEI has
 pirated application installed. Look 
 here:http://www.artfulbits.com/Android/try/reportPirate.aspx- report 
 form.http://www.artfulbits.com/Android/antipiracy.aspx- code integration.

 As a developer, I will definitely integrate their protection system in
 my application and WILL deny activation if IMEI is in the black list.

 On Nov 18, 10:43 pm, admin.androidsl...@googlemail.com



 admin.androidsl...@googlemail.com wrote:
  AlexK - you didn't mention where you get your data for the blacklist.

  I am guessing its based on pirated copies of your app. How are you
  determining which users have illegal copies?

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


[android-developers] Re: Android Market Anti-Piracy

2009-11-19 Thread Kaj Bjurman
So how do they they expect piracy to be reported? How do they handle a
worm or malicious program / user that reports all IMEI numbers that it
finds (or generates)?

Creating a program that generates IMEI and then reports them shouldn't
be that hard.


On 19 Nov, 15:40, nEx.Software email.nex.softw...@gmail.com wrote:
 @LambergaR: Because they are trying to trick the user into
 registering their phone to justify they are not a pirate, but in
 actuality, they user is being forced to report himself/herself as a
 potential pirate and to give their personal information so that it may
 be used against them in the future. Makes sense right? I have not
 installed the app they have created so I am not sure whether there is
 a privacy notice or something of the ilk, but if not... I'd be very
 concerned about what is happening with my personal information. For
 what it's worth, the online report page 
 athttp://www.artfulbits.com/Android/try/reportPirate.aspx
 does not have any privacy notice so I doubt that the application does.

 @Kaj Bjurman: Of course not, they only expect people to report their
 own phones... And they expect developers to ALWAYS request permission
 to retrieve the IMEI of the device, and Internet permissions. Sweet!
 Access to information about me / my phone and the ability to send it
 anywhere they wish... Sounds good to me.

 On Nov 19, 7:01 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Do they really expect people to manually report each phone?

  On 19 Nov, 12:09, Paul Turchenko paul.turche...@gmail.com wrote:

   Guess they are gathering data from different application vendors. As
   far as I can tell, they will tell that device is 100% blacklisted only
   if 2 of 3 application vendors have reported that particular IMEI has
   pirated application installed. Look 
   here:http://www.artfulbits.com/Android/try/reportPirate.aspx-reportform.http://www.artfulbits.com/Android/antipiracy.aspx-codeintegration.

   As a developer, I will definitely integrate their protection system in
   my application and WILL deny activation if IMEI is in the black list.

   On Nov 18, 10:43 pm, admin.androidsl...@googlemail.com

   admin.androidsl...@googlemail.com wrote:
AlexK - you didn't mention where you get your data for the blacklist.

I am guessing its based on pirated copies of your app. How are you
determining which users have illegal copies?

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


[android-developers] Re: Android Market Anti-Piracy

2009-11-17 Thread Kaj Bjurman
It's incorrect to believe that hackers/crackers wouldn't care about
removing the protection from a cheap products. The hackers/crackers
don't care about the price of the product, they just want to get
famous so they crack the most popular applications regardless of
price. They don't think in economical terms.

People who are buying products are however thinking in econimical
terms, so they might be less interested in looking for a cracked
version if the product is cheap, so having copy protection on a $1
product might be close to worthless.



On 16 Nov, 23:04, Paul Turchenko paul.turche...@gmail.com wrote:
 I highly doubt that anyone would do that for $1 application. Effort
 not worth trying.

 On Nov 16, 9:55 pm, strazzere str...@gmail.com wrote:

  Since reversing an application is a rather menial task now, whats to
  prevent a user from taking your application - stripping the protection
  and re-releasing it? Not to mention that IMEI spoofing to an
  application can be done with a little bit of research.

  More importantly, with your approach - what happens when someone
  strips out the protection, throws it into a nice little program - then
  bombs all the IMEI numbers they want? Then you'll have pirates being
  blocked who well, never pirated your application. Seems like an easy
  way to quickly make your blacklist pretty inaccurate.

  -Tim Strazzere

  On Nov 16, 2:02 pm, Rachel Blackman ceruleanspa...@gmail.com wrote:

   On Nov 16, 2009, at 10:34 AM, nEx.Software wrote:

Not to mention that just because someone might have pirated some app
at some time, doesn't mean that they pirated your app.
That's why it needs to be able to check against Google Checkout or
whatever payment processor is used...

   Also not to mention how many people buy out-of-contract phones off of 
   eBay to toy with new techy stuff.  What if someone gets their phone's 
   IMEI blacklisted in your database, goes and sells their phone, and 
   someone innocent now picks up the phone and finds abruptly they can't use 
   any of the apps linked into this antipiracy thing?  (And lest you say 
   that wouldn't happen, look at how many of the Xbox 360 consoles that have 
   gotten locked out of Xbox Live abruptly ended up on eBay, while the folks 
   who got locked out go get new consoles.  After all, Xbox Live uses 
   similar security methods, where the lockout applies to the hardware ID, 
   not merely the account.)

   This isn't to say that antipiracy methods aren't desirable or useful.  
   Just that if they bite /innocent/ users as well, you'll have a headache 
   to deal with.  Look at how many 'I can't see this app in the market!' 
   threads we already have, and how much frustration there is just from 
   developers over that.  Imagine the users adding to that with 'I paid for 
   this app off the store, but when I try to run it claims I pirated it!'

   In general, as a software developer, I tend to think that antipiracy 
   methods that allow some pirates through are better than antipiracy 
   methods that might flag innocent users as wrongdoers.

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


[android-developers] Re: Android Market Anti-Piracy

2009-11-17 Thread Kaj Bjurman
I doubt that it would be as much as 10%. Most people will just try to
find another app instead.



On 17 Nov, 19:12, AlexK kucherenko.a...@gmail.com wrote:
 On Nov 17, 7:14 pm, strazzere str...@gmail.com wrote:

  On Nov 17, 10:32 am, AlexK kucherenko.a...@gmail.com wrote:

   In my case was stolen application with price $1.29 - pirates copies
   reach 100-300 per day, sales become dead.

   So black list is the only way to protect my product for now.

  So you have had 100-300 new installs of pirated apps a day?
  Or consistently have 100-300 applications that are pirated run each
  day?

 I have popular product that was stolen and now are available on
 filesharing servers. Per day near by 100-300 people try to install it
 on phone and activate, but instead they just placing own IMEI into
 black list. And got nothing, application server side already change
 security keys and old application failed to activate.

  Your also assuming that if you had a perfect protection scheme, that
  all these people would buy your product.

 I expect that at least 10% of people from that black list will find
 application useful and buy it instead of stole 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] Re: Force locale for an application, bug in 2.0?

2009-11-13 Thread Kaj Bjurman
Thanks. I'll try that.


On 12 Nov, 20:31, monmonja almondmend...@gmail.com wrote:
 Add android:configChanges=locale to your activity nodes on the
 manifest file
 activity android:name=.Main android:configChanges=locale
 android:label=@string/app_name /

 Update the post 
 onhttp://almondmendoza.com/2009/01/28/force-localize-an-application-on-...
 :)

 monmonja

 On Nov 10, 3:43 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  I don't think that the process is crashing, at least not in the
  emulator since I can see all these logging messages:

  11-07 23:11:33.849: WARN/UsageStats(61): Something wrong here, didn't
  expect mypackagename to be resumed

  There are lots of them. It looks like it gets stuck in some kind of
  loop.

  Btw. It used to work, and I think it is great that it used to work.
  There are lots of people in the world who speak more than one
  language, where none of the languages are English, or they might
  understand English but have two other languages as preferred
  languages.

  Setting the OSlocaleto Swedish would make the application display
  the English resources if Swedish isn't available, but an application
  that I have installed might support e.g .Spanish, and that could be
  preferred over English.

  On 9 Nov, 22:15, Dianne Hackborn hack...@android.com wrote:

   No, changing the application'slocalelike this is not supported, and will
   not entirely work.  It shouldn't cause an activity to restart though...
   actually I can't imagine how this would cause an activity to restart, 
   since
   this method is much lower-level than the activity.  Maybe the process is
   crashing for some reason in this call?

   2009/11/9 Bahadır Yağan bahadir.ya...@gmail.com

Does anyone know if this method of changingLocalejust for one 
application
is a supported functionality?

--
Bahadır Yağan

On Mon, Nov 9, 2009 at 12:18 PM, ydario mc6...@mclink.it wrote:

Hi,

found the same problem here. Even this kind of code fails:

       Configuration config = 
context.getResources().getConfiguration();
       config.locale= newLocale;
        context.getResources().updateConfiguration(config,
                       context.getResources().getDisplayMetrics());

where newLocale is a properly createdlocaleinstance.

The strange thing is that I can get the above code to work when my
wizard library is running; the library code does not implement a new
activity, but simply uses the existing one. I compared code, but I
cannot find other real differences.

And I'm getting the resume problem also when I start an activity from
a non-GUI class, this worked from 1.1 to 1.6 :-(

Yuri

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

   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com

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

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


[android-developers] Re: Growing pains for Android developers??

2009-11-13 Thread Kaj Bjurman
You can test Android 2.0 applications in the emulator. I've been able
to correct a bug that I had on 2.0 even though I don't have a phone
that supports 2.0.



On 13 Nov, 13:57, WoodManEXP woodman...@gmail.com wrote:
 We have spent significant time  energy and $$ producing several
 Android applications on the bet/hope it will be able to cut into the
 iPhone market. Unfortunately little is happening.

 - The apps sales are sluggish (the apps are hardly even being pirated
 as far as we can tell).
 - ADP cannot be updated to Android 2.0 yet Google has pushed hard for
 development to be updated to 2.0 and the Droid phone is released. How
 is one to test?
 - The Google Market seems ineffective. Consider limitations like the
 short app descriptions for instance. Google Market has a way to go to
 catch up with the magic of iTunes.
 - There is void of two-way communication between Google and the
 Android developer base so rumor and conjecture and trial and error
 prevail.
 - Distribution license agreement is updated in a take it or leave it
 fashion (with no meaningful explanation or attempt to point out
 changes). What was that all about?

 The list of this dings goes on. Understandably it is a huge
 undertaking for Google/Verizon/HTC/Developers and the others to launch
 Android and support it to go after the market Apple iPhone has proven.
 On the plus side the SDK and ADP is obviously something Google has
 invested heavily in and the basic Android system is, IMHO, superior to
 iPhone system. So that's all good. Hopefully these developer
 irritations are part of the growing pains and will quickly be
 resolved.

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

2009-11-09 Thread Kaj Bjurman
No, I haven't reported it yet. The bug reporting page wanted some
information that I don't have access to right now, I will try to
remember to report the bug later today when I get home.


On 9 Nov, 20:39, Bahadır Yağan bahadir.ya...@gmail.com wrote:
 As a workaround you can recommend your users the MoreLocale application to
 change their Locale to Swedish.

 But I am also interested in application level locale setting. Did you report
 the issue?

 Best

 --
 Bahadır Yağan

 2009/11/9 Bahadır Yağan bahadir.ya...@gmail.com



  Does anyone know if this method of changing Locale just for one application
  is a supported functionality?

  --
  Bahadır Yağan

  On Mon, Nov 9, 2009 at 12:18 PM, ydario mc6...@mclink.it wrote:

  Hi,

  found the same problem here. Even this kind of code fails:

         Configuration config = context.getResources().getConfiguration();
         config.locale = newLocale;
          context.getResources().updateConfiguration(config,
                         context.getResources().getDisplayMetrics());

  where newLocale is a properly created locale instance.

  The strange thing is that I can get the above code to work when my
  wizard library is running; the library code does not implement a new
  activity, but simply uses the existing one. I compared code, but I
  cannot find other real differences.

  And I'm getting the resume problem also when I start an activity from
  a non-GUI class, this worked from 1.1 to 1.6 :-(

  Yuri

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  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: Force locale for an application, bug in 2.0?

2009-11-09 Thread Kaj Bjurman
I don't think that the process is crashing, at least not in the
emulator since I can see all these logging messages:

11-07 23:11:33.849: WARN/UsageStats(61): Something wrong here, didn't
expect mypackagename to be resumed

There are lots of them. It looks like it gets stuck in some kind of
loop.


Btw. It used to work, and I think it is great that it used to work.
There are lots of people in the world who speak more than one
language, where none of the languages are English, or they might
understand English but have two other languages as preferred
languages.

Setting the OS locale to Swedish would make the application display
the English resources if Swedish isn't available, but an application
that I have installed might support e.g .Spanish, and that could be
preferred over English.




On 9 Nov, 22:15, Dianne Hackborn hack...@android.com wrote:
 No, changing the application's locale like this is not supported, and will
 not entirely work.  It shouldn't cause an activity to restart though...
 actually I can't imagine how this would cause an activity to restart, since
 this method is much lower-level than the activity.  Maybe the process is
 crashing for some reason in this call?

 2009/11/9 Bahadır Yağan bahadir.ya...@gmail.com





  Does anyone know if this method of changing Locale just for one application
  is a supported functionality?

  --
  Bahadır Yağan

  On Mon, Nov 9, 2009 at 12:18 PM, ydario mc6...@mclink.it wrote:

  Hi,

  found the same problem here. Even this kind of code fails:

         Configuration config = context.getResources().getConfiguration();
         config.locale = newLocale;
          context.getResources().updateConfiguration(config,
                         context.getResources().getDisplayMetrics());

  where newLocale is a properly created locale instance.

  The strange thing is that I can get the above code to work when my
  wizard library is running; the library code does not implement a new
  activity, but simply uses the existing one. I compared code, but I
  cannot find other real differences.

  And I'm getting the resume problem also when I start an activity from
  a non-GUI class, this worked from 1.1 to 1.6 :-(

  Yuri

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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

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

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


[android-developers] Re: Force locale for an application, bug in 2.0?

2009-11-08 Thread Kaj Bjurman
Thanks for the answer. The workaround works, but that does
unfortunately mean that users who got Android 2.0 won't be able to use
Swedish in the application.

Btw. Do you know if I should report the updateConfiguration bug?


On 7 Nov, 23:35, Mark Murphy mmur...@commonsware.com wrote:
 Kaj Bjurman wrote:
  Does anyone know how to check the API version on the phone so that I
  at least can add a quickfix? (A conditional check and only invoce
  updateConfiguration if the API version is less than 5)

 android.os.Build.VERSION has the values you need. Note that the integer
 version is relatively new, so you probably want to use the string instead.

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

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

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


[android-developers] Re: Force locale for an application, bug in 2.0?

2009-11-08 Thread Kaj Bjurman
Thanks I'll do so.

Btw. This was the only way that I knew of in which I would be able to
let users select Swedish as application language. The Android OS in
1.5 did not have a Swedish locale in the settings menu, and my 1.6
still doesn't have a Swedish locale.



On 8 Nov, 14:28, Mark Murphy mmur...@commonsware.com wrote:
 Kaj Bjurman wrote:
  Thanks for the answer. The workaround works, but that does
  unfortunately mean that users who got Android 2.0 won't be able to use
  Swedish in the application.

  Btw. Do you know if I should report the updateConfiguration bug?

 Not sure. I wasn't aware that the technique your using was supposed to
 work. I was under the impression that only the user could change the
 language. But, this is not an area I have spent tons of time in.

 If it worked on 1.5 and 1.6, it's probably worth posting to b.android.com.

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

 Android App Developer Books:http://commonsware.com/books

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


[android-developers] Force locale for an application, bug in 2.0?

2009-11-07 Thread Kaj Bjurman
Hi,

I got a widget that currently is working with Android 1.5 and 1.6. A
user who has Motorola Droid phone with Android 2.0 did however report
a bug.

After some digging around I found that this is causing a bug that
causes an infinite loop:

String languageToLoad  = en;
if (configuration != null  configuration.language == 1) {
languageToLoad  = sv;
}
Locale locale = new Locale(languageToLoad);
Locale.setDefault(locale);
android.content.res.Configuration config = new
android.content.res.Configuration();
config.locale = locale;
//Causes bug in Android 2.0. But why?
context.getResources().updateConfiguration(config, context.getResources
().getDisplayMetrics());

The thing that happens is that my activity gets displayed for a very
very short time, then it is hidden, and gets displayed again. It looks
like flickering, but the logging output says this:

11-07 23:11:33.849: WARN/UsageStats(61): Something wrong here, didn't
expect mypackagename to be resumed
11-07 23:11:34.339: WARN/UsageStats(61): Something wrong here, didn't
expect mypackagename to be resumed
11-07 23:11:34.829: WARN/UsageStats(61): Something wrong here, didn't
expect mypackagename to be resumed
11-07 23:11:35.309: WARN/UsageStats(61): Something wrong here, didn't
expect mypackagename to be resumed

Everything works fine if I remove the following line:
context.getResources().updateConfiguration(config, context.getResources
().getDisplayMetrics());


Does anyone know what to do in order to solve the problem? Should I
report this bug?

Does anyone know how to check the API version on the phone so that I
at least can add a quickfix? (A conditional check and only invoce
updateConfiguration if the API version is less than 5)

Thanks
Kaj



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 get other applications touch screen x,y values when application running in the background?

2009-08-17 Thread Kaj Bjurman

What's an AP? Access Point does not sound correct in this context, did
you mean app?

Have you written both apps, or are you saying that you'd like to write
some kind of spyware that can spy on any application? Why in that
case?




On 16 Aug, 16:39, Tsung-Ming wang.tsungm...@gmail.com wrote:
 I want to use an AP running in the background, and can get the other
 AP touch screen x,y values.
 Beacause i use the View class the ontouchevent, but this seems to get
 current AP running touch event.
 Which the class or function can meet the needs of this.

 Can provide the program or books to reference.

 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: Reading Calendar?

2009-08-14 Thread Kaj Bjurman

Ok. Thanks.

Do you know roughly when it will be available? In 2.0 or later?


On 14 Aug, 00:36, Justin (Google Employee) j...@google.com wrote:
 The calendar data provider is not currently exposed. Your best, albeit
 not simple, bet is to use the Google Calendar web API to access the
 user's calendar data.

 Cheers,
 Justin
 Android Team @ Google

 On Aug 10, 7:43 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Hi,

  I think I've seen somewhere that it's still not possible to read
  Google Calendar entries? I tried to search the forum, but didn't find
  any relevant threads. They mostly contain questions on
  java.util.Calendar.

  Can I read entries? I understand that it might be fragile if it still
  isn't in the public API, but I don't mind updating my code when the
  API becomes public.

  (I don't need to modify or create new entries)

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

2009-08-12 Thread Kaj Bjurman

You haven't told us how many dots that you have, but I do think it
sounds like an odd design. What kind of application is it? How often
are they moved? How many dots do you have? What do they represent?

I might of course be wrong here, but this sounds a bit like a common
problem that I often see in people who are starting with game
programming and is using e.g. one thread per bullet or what ever
they have that is moving.


On 11 Aug, 20:10, Jiri jiriheitla...@googlemail.com wrote:
 Thanx Yusuf,

 your advice is right, i should optimise later. I have to admit i am just
 started exploring Java and the android API, so hence the sloppyness.

 The main point is, that being so new, i have to post these kind of
 questions to take away some insecurity on choices i make. If I
 understand your point correctly, it is not bad practice what i did. I
 just need to optimize...

 Using a dotmanager, isnt it more expensive to go through all the dots an
 update them. I can imagine by using the architecture as is and not
 implement another structure, this would be faster.

 Any ideas on that?

 Jiri



 Yusuf T. Mobile wrote:
  Code first for simplicity then optimize if/as needed. That being said
  (well, more like pontificated, sorry), a simpler design would be to
  aggregate all your dots into a DotManager. This would listen and draw
  all the dots as needed. Aggregation works if all the dots are similar
  enough that their code can be centralized, and if I understand your
  problem correctly (all dots listen for the same event and then they
  all move), my brilliant and royalty-free design would be appropriate.

  Yusuf Saib
  Android
  ·T· · ·Mobile· stick together
  The views, opinions and statements in this email are those of the
  author solely in their individual capacity, and do not necessarily
  represent those of T-Mobile USA, Inc.

  On Aug 11, 9:13 am, jiriheitla...@googlemail.com
  jiriheitla...@googlemail.com wrote:
  I was wondering if the following is considered good practice.
  I am creating mulitple Dot instance. A Dot instance is a value object
  containing x,y, color, diameter fields.
  I draw each created Dot to a view:
  code
         canvas.drawCircle( dot.getX(),dot.getY(),dot.getDiameter
  (),paint);
  /code

  Now i want all the Dots to listen to a certain event, lets say that i
  want to click a button and move all the Dots.
  What i do is in the Dot constructor i add this code:
  code
     IntentFilter intentFilter = new IntentFilter
  (org.dadata.demo.SEND_TO_REACTOR);
     Appcontext.registerReceiver(this, intentFilter);
     ...
      @Override
      public void onReceive(Context context, Intent intent) {
          this.x += 5;
      }
  /code

  Then from my button i send the intent :

  code
  intent.setAction(org.dadata.demo.SEND_TO_REACTOR);
  getApplicationContext().sendBroadcast(intent);
  View.invalidate();
  /code

  I am wondering if someone could give me some feedback on this. Is it
  expensive for instance, and are there better ways to achive the same.

  Thank you,

  Jiri
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Will a notification still work if the device once shut down.

2009-08-10 Thread Kaj Bjurman

An Android device that is turned off, can't be started by an alarm.
(Unlike e.g. SE and Nokia phones).

Set the alarm clock on your Android phone, then turn it off. It will
be kept off.



On 6 Aug, 10:42, guishenl...@gmail.com guishenl...@gmail.com
wrote:
 Hi all,
     I have an application with notification. I want to keep the
 notification working even if the device once shut down just like an
 alarm. Could anyone give me some sample code to help me?
 Thank you in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Reading Calendar?

2009-08-10 Thread Kaj Bjurman

Hi,

I think I've seen somewhere that it's still not possible to read
Google Calendar entries? I tried to search the forum, but didn't find
any relevant threads. They mostly contain questions on
java.util.Calendar.

Can I read entries? I understand that it might be fragile if it still
isn't in the public API, but I don't mind updating my code when the
API becomes public.

(I don't need to modify or create new entries)

Thanks
Kaj

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



[android-developers] Re: Can I add a data column to the Contacts db?

2009-08-07 Thread Kaj Bjurman

I wouldn't do it even if you could. Sounds like a fragile design that
will break during upgrades and if other applications tries to do the
same.

Create a database of your own, and have some kind of id that
references the entry in the contacts db.



On 7 Aug, 05:44, cafffiene cafffi...@gmail.com wrote:
 Can I add a column of data to the Contacts db, such as birthday,
 favorite color, whatever.  Or does the platform/ framework make this
 difficult?  If possible, would I do it through the contacts content
 provider?  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: China to have there own Android Market?

2009-08-06 Thread Kaj Bjurman

I'm not a lawyer, but I can't see that it in any way restricts your
rights on distributing it through other channels than the Android
Market. The agreement does also say this:

2.1This Android Market Developer Distribution Agreement
(“Agreement”) forms a legally binding contract between you and Google
in relation to your use of the Market to distribute Products. In order
to use the Market to distribute Products, you must first agree to this
Agreement by clicking to accept where this option is made available to
you. You may not distribute Products on the Market if you do not
accept this Agreement.

So the document is about your usage of Android Market as far as I can
see.


On 6 Aug, 07:27, CraigsRace craig...@gmail.com wrote:
  As far as I know .. NetDragon is an evil company..

 Really, why do you say that?  I googled them, Electronic Arts are
 working with them.  They pulled in $595 million last year.
 Having said that, I don't want to be the ginny pig.  I'd much prefer
 to know that somebody else knows something about this separate Chinese
 Android Market.

  OpHone Sdk is Android 1.0 you have to port it to Android  1.0 for it work

 I asked them about the OPhone SDK only working on 1.1, no response.

  Do you have any agreement with Google that says that you can't do this?

 Who knows, I'd need a lawyer to understand all of the Google
 Agreement:  http://www.android.com/us/developer-distribution-agreement.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: programmatic screenshot

2009-08-05 Thread Kaj Bjurman

I tried this a few days ago, and couldn't find a way to do it in pure
Java. There can of course still be a way to do it, but it does also
look like screenshot apps are using native code as part of their
implementation.

I'm still pretty new on Android development, but I don't think that
the real phone is listening on a socket under normal circumstances. It
will listen on the USB channel. I think I've seen a post that said
something being able to use ethernet over USB, but I can't remember
where, and I don't know if it helps.



On 4 Aug, 21:11, NTDYLF notthedroidyourelooking...@gmail.com wrote:
 Hello all y'all. How can I take a screenshot programmatically? So far
 I've learned that:

 1) DDMS does it by sending framebuffer: to the adb service over a
 socket, which takes a screenshot in framebuffer_service.c that it
 sends back.
 2) There are some proprietary screenshot apps out there that stipulate
 the user must have root access, I'm not sure why.

 Would it be possible for an Android app to send framebuffer: to its
 own adb service and get the screenshot that way?

 Thanks in advance.

 ntdylf
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Unable to write text file to sdcard on physical G1 device

2009-08-05 Thread Kaj Bjurman

How does it fail? I wrote some code that creates a directory on the
sdcard, and writes files to that directory. I can't remember that I
had any problems at all.

.. I'm however root on the phone, but I hope that that doesn't matter.

File directory = new File(/sdcard/mydir);
if (!directory.exists()) {
directory.mkdirs();
}
FileOutputStream out = new FileOutputStream(directory.getPath() 
+ /
filename.txt);
//Write to out




On 5 Aug, 00:19, doubleminus doublemi...@gmail.com wrote:
 Any help here? I'm still flummoxed and unable to write to the sd card.

 Thanks!

 double

 On Jul 29, 1:39 pm, doubleminus doublemi...@gmail.com wrote:



  So...it seems that something is messed up with my permissions, as
  noted above. Is this the case?  What is the remedy here?

  I've tried twiddling with some settings on the phone to get access to
  thesdcard...but no luck. Please let me know.

  Thanks,
  double

  On Jul 26, 1:17 am, doubleminus doublemi...@gmail.com wrote:

   This is for a physical device.

   ddms shows:
   +sdcard   permissions: d---rwxrwx

   I still cannot write to thiscard.

   thanks,
   double

   On Jul 17, 7:40 pm, ekwang ekwa...@gmail.com wrote:

You can use ddms tool for verify whether sdcard was inserted or not.

#android-sdk-windows-1.5_r2\tools\ddms
select Device - File Explore

below is correct permissions value.

+datapermissions : drwxrwx--x
+sdcardpermissions : drwxrwxrwx
+system   permissions : drwxr-xr-x

If sdcard permissions was look d-
It means sdcard is not inserted.

On Jul 18, 7:24 am, doubleminus doublemi...@gmail.com wrote:

 Is it a permissions issue?  Trying to touch the sdcard via adb shell
 gives me a permission denied message...

 On Jul 16, 10:49 pm, doubleminus doublemi...@gmail.com wrote:

  Right now, file_name is just set to 12880+-+po_number.getText
  ().toString();

  When I put /sdcard/ (or sdcard/ into my file path I get
  IOException: Parent directory of file does not exist: 
  /sdcard/sdcard/
  12880-231

  If I get rid of the sdcard/ prefix, I get this exception:
  FileNotFoundException: 
  /data/data/com.heroku.blacksky/files/12880-222

  Here's the new file creation code, based on everyone's suggestions:
   file1 = new File(Environment.getExternalStorageDirectory(),
  file_name);
file1.createNewFile();
file_out =  new FileOutputStream(file1);
buf = new BufferedOutputStream(file_out);
out_stream = new OutputStreamWriter(buf);

  Please let me know your thoughts. I'm still quite confused by this.

  double

  On Jul 16, 12:12 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:

   I can't see that you are using file1 after that line. You are 
   using
   file_name.

   On 14 Juli, 18:09, doubleminus doublemi...@gmail.com wrote:

Isn't that what the first lines of code do?

File file1 = new File(Environment.getExternalStorageDirectory(),
file_name);

On Jul 13, 3:02 pm, Streets Of Boston flyingdutc...@gmail.com 
wrote:

 Simple. :-)
 The error says that the file does not exist... that means you 
 should
 create it.
 Use File#createNewFile().

 On Jul 13, 5:53 pm, doubleminus doublemi...@gmail.com wrote:

  Romain is?  I don't understand. Is there something I should 
  be doing
  to avoid filenotfound exception?

  On Jul 13, 12:40 am, 郑伟 loveheaven_zheng...@hotmail.com 
  wrote:

   You are right...

Date: Sun, 12 Jul 2009 21:29:28 -0700
Subject: [android-developers] Re: Unable to write text 
file to sdcard on  physical G1 device
From: romain...@google.com
To: android-developers@googlegroups.com

Hi,

Instead of:

 FileOutputStream file_out = openFileOutput
 (file_name,MODE_WORLD_READABLE);

Just use:

FileOutputStream file_out = new 
FileOutputStream(file_name);

This should work.

On Sun, Jul 12, 2009 at 8:10 PM, 
doubleminusdoublemi...@gmail.com wrote:

 I need to write a fairly simple .csv file to the 
 device's sdcard (so
 it can then be emailed via Intent). The below code 
 does not write the
 file.

 File file1 = new 
 File(Environment.getExternalStorageDirectory(),
 file_name);
 FileOutputStream file_out = openFileOutput
 (file_name,MODE_WORLD_READABLE);
 BufferedOutputStream buf = new 
 BufferedOutputStream(file_out);
 OutputStreamWriter out_stream = new

[android-developers] Re: how to load a .so library in a apk?

2009-08-04 Thread Kaj Bjurman

I'm not sure about this, since I haven't done it myself, but I've
heard that some people place the libraries under res/raw, and then
they copy it to /data/data/your-package-name when it's first started.


On 4 Aug, 04:53, xuxiake2...@gmail.com xuxiake2...@gmail.com
wrote:
 I have a .so library ,which I had  put  in directory  assets .   But
 how can i load it ?

 I can't use System.loadLibrary or System.load  because i can't get the
 path.  thanks

 in advance for your answers.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 load a .so library in a apk?

2009-08-04 Thread Kaj Bjurman
That code contains at least one bug.

This loop isn't correct:

  while (bis.read(temp)  0) {
out.write(temp);
  }

bis.read returns the number of bytes that was read, that number can be
larger than 0 but still less than temp.length. You should do something
like this instead:

int len = 0;
while (( len = bis.read(temp))  0) {
out.write(temp, 0, len);
}

Your file wile otherwise be corrupt.



On 4 Aug, 13:14, spark xuxiake2...@gmail.com wrote:
 yes,I have already did this .

 private void loadLibraryFromAssets() {
                 AssetManager am = getAssets();
                 String path = null;
                 try {
                         InputStream in;
                         in = am.open(lib/libjni_xxx.so);

                         BufferedInputStream bis = new BufferedInputStream(in);

                     path = Enviroment.getAppPath(this) + libjni_xxx.so;

                         File file = new File(path);

                         if (!file.exists()) {
                                 file.createNewFile();
                         }

                         FileOutputStream out = new FileOutputStream(path);
                         byte[] temp = new byte[2048];
                         while (bis.read(temp)  0) {
                                 out.write(temp);
                         }
                         bis.close();
                         out.close();

                         //am.close(); can't be closed
                 } catch (IOException e) {
                         e.printStackTrace();
                         Log.e(TAG,load Library From Assets error:  + 
 e.getMessage());
                 }

                 try {
                         System.load(path);
                 } catch (UnsatisfiedLinkError e) {
                         String errorMsg = e.getMessage();
                         Log.e(TAG,System.load error:  + errorMsg);
                 } catch (SecurityException e) {
                         String errorMsg = e.getMessage();
                         Log.e(TAG,System.load error:  + errorMsg);
                 }

         }

 On 8月4日, 下午3时03分, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  I'm not sure about this, since I haven't done it myself, but I've
  heard that some people place the libraries under res/raw, and then
  they copy it to /data/data/your-package-name when it's first started.

  On 4 Aug, 04:53, xuxiake2...@gmail.com xuxiake2...@gmail.com
  wrote:

   I have a .so library ,which I had  put  in directory  assets .   But
   how can i load it ?

   I can't use System.loadLibrary or System.load  because i can't get the
   path.  thanks

   in advance for your answers.- 隐藏被引用文字 -

  - 显示引用的文字 -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: This bug is costing us money every month

2009-08-04 Thread Kaj Bjurman

How can you know? He could  have had another Android phone prior to
the G2.

@Op. You could as a workaround use an application like APNDroid, but
the bug should be fixed.


On 3 Aug, 23:42, Disconnect dc.disconn...@gmail.com wrote:
 The G2 JUST came out - it may cost you money next month, but it hasn't cost
 you anything yet...

 On Mon, Aug 3, 2009 at 3:50 AM, Mister Helmut mister.hel...@gmail.comwrote:





  Hello,

  I'd like to refer to the issue 2379 :
 http://code.google.com/p/android/issues/detail?id=2379

  I know that I may be in infringement of the discussion group guideline
  but this is a kind of SOS message.
  This bug is actually costing money every month to all of us going
  aboard very often (or just occasionnaly).
  As of me, in my company, we have G2's as professional phones, and we
  ALL get that charges every month (most of us don't live in the country
  we are working in).

  This bug has a new status since april, and we can't imagine it not
  being fixed for the next 6 month as our phone provider wont refund us
  anymore.

  We may try to correct it ourself, but we are very confident with the
  lower level stack of android source code and we just don't really have
  the time to do it.

  Thanks for reading, and I feel sorry about this message, as I know
  that this kind of message isn't percived very well but please
  understand our 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: 1.5_r3 backward compatibility

2009-08-03 Thread Kaj Bjurman

Huh? My device hasn't been updated, and I bet that there are lots of
countries where the mobile operators haven't sent out any updates.



On 3 Aug, 01:59, Fred Grott(shareme) fred.gr...@gmail.com wrote:
 Peter all devices were updated to 1.5r3 by mobile operators so what
 devices are u targeting that have 1.5r2 or 1.5r1?

 Yes, they should explain this somewhere..

 Fred Grotthttp://mobilebytes.wordpress.com

 On Aug 2, 12:59 pm, Peter Jeffe pje...@gmail.com wrote:



  Sorry if I missed this in the release notes, but if I build against
  the 1.5_r3 SDK are there any compatibility issues with running it on
  devices that are at previous levels of 1.5?  I would certainly hope
  not, but I've learned not to make such assumptions. :-)

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



[android-developers] Re: Android Dev Phone 1 out of stock

2009-07-31 Thread Kaj Bjurman

Another option is to order a new phone from an online store.


On 27 Juli, 21:15, AndyB rn.an...@gmail.com wrote:
 Nobody seems to have answered the question,

 Like you, i recently got fed up waiting for the G1 to be released in
 my country (Ireland) so I decided to order the ADP1, only to find out
 there was no stock.

 If you check the View Cart page of the order 
 website,https://android.brightstarcorp.com/cart.php, it says they expect
 availability to resume on March 4.
 I rang them to confirm that it would take 9 months, and that message
 is a mistake. I was told the phone would be restocked by the end of
 August.

 So i guess its eBay or wait a month.

 On Jul 25, 10:14 am, kenpark patrick.seiff...@gmx.net wrote:



  Hej.

  Yesterday I registered in the Android Market Place to be able to
  retrieve one of the dev devices. But after I had registered and paid
  the fee I was told that the dev phones are currently out of stock.
  Since I need one of those devices for my masterthesis I was very
  unhappy to hear that it may take a few weeks.

  Does anyone know (or can one estimate) when they might be available
  again?

  Regards,
  Kenpark
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-24 Thread Kaj Bjurman

What didn't you understand in my last reply? It is trivial unless I
have misunderstood something.

I guess you got unit tests? Now take the code below. Replace the
download/decrypt code in your unit tests with something like what I
posted previously:

Properties license = new Properties();
license.put(p, TelephonyMgr.getLine1Number());
license.put(d, Settings.System.getString(getContentResolver(),
Settings.System.ANDROID_ID);
license.put(e, aDateInTheFuture);

Then run your unit tests again. Downloading won't fail since we have
_replaced_ the download code, and no decryption would fail, since we
aren't decrypting anything. We replaced that code as well. You don't
even need to find all license check snippets that the developer has
springled his code with, since they all will check against our valid
license that we created above.

I really can't believe that you don't see this. Please tell me in what
way it fails given my description above.



On 23 Juli, 23:07, Al Sutton a...@funkyandroid.com wrote:
 We're going to update the page, but we'd kind of assumed it was an
 obvious thing to check.

 As for your latest idea, the download code downloads an encrypted file
 so an error would be thrown during decryption which would show up
 problmes with a spoof server or modified download code.

 I think you get my point. You may think it's trivial to circumvent,
 but when you get down to it there are various things we've done to
 make it a lot trickier than an initial inspection would make you
 believe, which is why you've still not come up with a reproducable
 system for cracking it. Even if you did crack a version of an
 application, the steps you took wouldn't be easily reproduced for
 other applications and even other versions of the application if the
 developer moved the decryption/test code around.

 Al.

 On Jul 23, 5:54 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Shouldn't the code on the page say that in that case, and it's still
  very easy to spoof. Replace the code that downloads the certificate
  and encrypts it with code that does this:

  Properties license = new Properties();
  license.put(p, TelephonyMgr.getLine1Number());
  license.put(d, Settings.System.getString(getContentResolver(),
  Settings.System.ANDROID_ID);
  license.put(e, aDateInTheFuture);
  ..
  ..

  and so on.

  I think you get the point. We have enabled all settings. Remember I'm
  not a hacker/cracker and I have already shown you that it's very easy
  to crack your system. You aren't protecting the code. Applications
  will still be pirated very easy, and it's even possible to write an
  application that does it automatically.
  Users of the applications will also be very frustrated if they for
  some reason can't contact your license servers, so the value that you
  are adding is about zero.

  On Jul 23, 5:38 pm, Al Sutton a...@funkyandroid.com wrote:

   And doing what you say should cause the application to operate as if
   no license is present (i.e. demo mode).

   The demo code is to cover all bases for all types of license where the
   properties in the license are unknown. If you know that you'll be
   using a specific license property your app should enter demo mode if
   that property isn't present.

   Al.

   On Jul 23, 1:45 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:

Sorry to say, but there's a huge flaw in your examples. The snippet
below is taken from your link:

X509EncodedKeySpec keySpec = new X509EncodedKeySpec
(ANDAPPSTORE_APP_KEY);
KeyFactory factory = KeyFactory.getInstance(RSA);
PublicKey key = factory.generatePublic(keySpec);
Cipher cipher = Cipher.getInstance(RSA/ECB/PKCS1Padding);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] original = cipher.doFinal(LICENSE);

Properties props = new Properties();
props.clear();

ByteArrayInputStream bis = new ByteArrayInputStream(original);
try {
  props.load(bis);

} finally {
  bis.close();
}

Very few classes are using using e.g X509EncodedKeySpec, so it's very
easy to find all classes that are using it, and it's thus very easy to
find that section of code. Now replace all operands in the class file
with no operation instead, except this part:

Properties props = new Properties();

I.e. we are creating an empty license.

Now read all your other code snippets with this in mind.

E.g.

4(c)(i). Testing the phone number

String licensePhoneNumber = license.getProperty(p);
if( licensePhoneNumber != null ) {   //Uh, uh. An empty license
returns null, we won't do any checks.

  TelephonyManager TelephonyMgr =
      (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

  String devicePhoneNumber = TelephonyMgr.getLine1Number();

  if(licensePhoneNumber.equals(devicePhoneNumber) == false) {
    throw new RuntimeException(** Phone Number Check Failed **);
  }

}

Remember that license now is an empty instance

[android-developers] Re: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-24 Thread Kaj Bjurman

As I said previously. I have tried to protected java applications, and
I have done what I described with pure java applications, without
having the source code (I have even done it in assembler/machine code
on non java applications). I don't know much about the dex format and
what tools that are available to modify compiled classes, but it's
only a matter of time before they are here, if they don't exist right
now.

Crackers don't think about if a program is expensive or not. They only
want to get known for their talents, and they crack all popular
applications, even if they are almost for free. So all popular
applications get cracked, regardless of price, and time isn't an issue
for the cracker. He doesn't think in economical terms.



On 24 Juli, 10:44, Al Sutton a...@funkyandroid.com wrote:
 The confusion arose because your previous post said Replace the code
 that downloads the certificate and encrypts it, in this post you're
 talking about the download/decrypt code, the first is a combination
 of client code (download) and server code (encryption), the latter is
 client-only code.

 Referring to the download/decrypt replacement, the problem here is the
 amount of time it would take to find where the download/decrypt code
 resides in a compiled app, replace it, and recompile it. If you had
 the original source code then yes, you could do a drop in replacement,
 but if you had the source code you could easily strip out any
 protection mechanism.

 Seriously, try it on a compiled application, you'll find it takes you
 a lot longer than you think, and longer than many crackers would be
 willing to spend on a low-cost app.

 Al.


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

2009-07-23 Thread Kaj Bjurman

Case 2 doesn't hold. It's still a bit of security by obscurity.
There are several ways to remove what you describe. One way would be
to run the program in the emulator/debugger and see where it fails.
Then check what that method does and correct the logic. Run it again
in the emulator to see if it still fails, then patch the next place.
This is usually how programs written in other languages are cracked.
(E.g. written i C/C++). Cracking in those cases is usually done in a
debugger for assembler.

What I described in the scenario above is where they aren't using any
code from you.
I don't know what your code look like, or what it does. But I still
guess that you have classes that others can use. It's in that case
pretty easy to stub those classes out, and cracking all programs in
your market would in that case mean that they just have to find out
how your protection works, stub out code from you, and then apply it
to all programs.

Note that I'm not a hacker/cracker, but I'm curious, and I have myself
tried to protect programs.


On 22 Juli, 19:58, Al Sutton a...@funkyandroid.com wrote:
 That form of approach is one of the main reasons the AndAppStore
 system can download an encrypted license to the device which can be
 stored and decrypted as neccessary. This means developers can;

 1) Occasionally check the license is still valid by retrying to
 download it, and if it doesn't download due to a network/server error
 the app can use the locally cached copy.

 2) Because the client code is open developers can embed it wherever
 they want in their program logic as opposed to being a single library
 which can be stripped out and replaced with an always return true
 version.

 3) Detect spoof servers because a spoof server will be unable to
 return a properly encrypted file and thus developers can detect
 decryption errors and mark them as spoofing attempts.

 Al.

 On Jul 22, 6:50 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Correct, Removing the part that makes the requests, and just return
  true is what people usually are doing.

  On Jul 22, 5:01 pm, Micah mi...@ourmailbox.net wrote:

   The pirates will either strip out the licensing requests from the
   application or they will spoof a licensing server.  Meanwhile, your
   legitimate users can't use your application when they don't have
   access to the licensing server (it's down, they don't have internet
   access, etc.).

   On Jul 22, 7:55 am, Android Development indodr...@gmail.com wrote:

Maybe an activation licensing key for each binary may be the solution 
for
this. But then again, its easier said than done.

On Wed, Jul 22, 2009 at 8:20 PM, Moto medicalsou...@gmail.com wrote:

 I know that piracy will never end, I mean I'm a solo developer trying
 to fight a war that multi-million companies have spent many millions
 on protecting their content and still they get pirated...

 Well yes there could be some ugly side effect if google adds more 
 anti-
 pirating features, so I guess I'm not too much for that...  But I
 believe there could be a better Android Market system that allows
 anyone with a phone to purchase an app and put it on their SDcard.
 Why not do the following?

 1. User purchases app via Android Market.
 2. Phone sends unique ID IME? to server.
 3. Android Market server prepares application with encryption
 according to given phone information.
 4. Application downloads to phone. put it anywhere, SD card.. etc...
 5. Application only installs on the correct phone.

 I know this method would soon or later be hacked but it's a better way
 than current methods, since we still have those faulty Android version
 that allow rooting..

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

2009-07-23 Thread Kaj Bjurman

You don't need xml to represent hierarchies.

You can represent your notes like this, and write your data in this
way (if you want to use binary):

public static byte[] encode(final ArrayListNote notes) throws
IOException {
int size = notes.size();
ByteArrayOutputStream out = new ByteArrayOutputStream
(NOTE_AVERAGE_SIZE * size);
DataOutputStream data = new DataOutputStream(out);
for (int i = 0; i  size; i++) {
Note note = notes.get(i);
data.writeUTF(note.parentFolder != null ? 
note.parentFolder : );
data.writeUTF(note.title != null ? note.title : );
data.writeUTF(note.text != null ? note.text : );
}
data.flush();
return out.toByteArray();
}

public static final class Note {

public Note(String parentFolder, String title, String text) {
this.parentFolder = parentFolder;
this.title = title;
this.text = text;
}

public String parentFolder;
public String title;
public String text;
}


All you need to do when you read is to use a Map where you place notes
that belong to a certain folder. You can have unlimited depth if you
do that.




On 22 Juli, 22:34, gnugu rho...@gmail.com wrote:
 Richard,
 thanks for suggestion.

 My notes are structured. The app allows for the notes to be in the
 folders one level deep. That's why I opted for XML.

 I'll try to find out the presentation and post the link here for
 others.

 On Jul 22, 1:17 pm, Richard Schilling richard.rootwirel...@gmail.com
 wrote:



  Yes, there were some good suggestions.  And, yes, using the database
  is a great idea.  But I have another, and I use  this general approach
  a lot when I need to import/export data or just ship files around on a
  device, or when memory and performance are key.

  XML parsers, streaming or in-memory DOM are time consuming and often
  not ncessary when you're working with simple data like strings.  XML
  is best used when you need to tag the data with a lot of attributes.
  Not only that, but XML bloats the memory requirements of your
  application multiple times because you have to save all XML characters
  (e.g. '', '=').

  You'll get the most speed out of processing, especially I/O operations
  if you first reduce each note to a binary form (e.g. array of
  characters).  If you need to store all the notes in a single file,
  then I would suggest some format like this:

  HEADER LENGTH STRING HEADER LENGTH STRING  .etc .

  Here's some code.

  public static byte[] encode(String s){

                  byte[] header = CAFEBABE.getBytes(); // or some other 
  magic token
                  byte[] chars = s.getBytes();
                  byte[] sizeBytes = intToByteArray(chars.length); // convert 
  an int
  to a byte array - defined elsewhere.

                  int totalLength = header.length + chars.length + 
  sizeBytes.length;
                  ByteBuffer buf = ByteBuffer.allocate(totalLength);
                  buf.put(header);
                  buf.put(sizeBytes);
                  buf.put(chars);

                  buf.position(0);
                  return buf.array();
          }

  Pass each string in, and then pack the results from each call into
  your file.

  Richard Schilling
  Root Wireless

  On Jul 22, 12:57 pm, gnugu rho...@gmail.com wrote:

Just creating 1000 objects isn't going to take 45 seconds, it sounds 
like

   I was running it in the emulator with the debugger attached. I'll
   check logs and try the profiler.

   Thanks.

   On Jul 22, 12:02 pm, Dianne Hackborn hack...@android.com wrote:

Just creating 1000 objects isn't going to take 45 seconds, it sounds 
like
you have something really bad going on somewhere.  With it taking that
amount of time, you will probably quickly see some serious hot spots if 
you
run the profiler.

Also if you are seeing log messages about the GC running during that 
time,
this means that something in your code is creating tons and tons of
temporary objects.  Again the profiler should help a lot in tracking 
this
down.

On Wed, Jul 22, 2009 at 11:39 AM, gnugu rho...@gmail.com wrote:

 Dianne,

 It is not reading and writing that's slow.

 I have a class that has Notes field (ArrayListNote). I wrote my test
 to create 1000 note objects and add it took 45 seconds.
 Because I can't get XML string out of DOM Document I can't use the
 Document as my storage for notes which leaves me with creating all
 these objects as I read the XML.

 It would be ideal for me to use MySQL to store the notes but then I
 would want to encrypt the table as a whole rather then individual
 records.

[android-developers] Re: Is there a way to auto-power on the phone?

2009-07-23 Thread Kaj Bjurman

All my SE phones have been able to turn on themself if I had an alarm
set, and the phone was turned off. My Android phone (HTC Magic) can
however not do that. The support is there in Linux, so I don't know it
this is a hardware thing, or a missing feature in Android.


On 23 Juli, 07:42, quill quill...@163.com wrote:
 The app is only for users to set time when to turn on the phone or
 power off. How to turn on the phone when it is power off? If we power
 off our phone or take out battery, the clock still show us a correct
 time when we power it on. And the alarm clock also works when we power
 off the phone. So I think it is also possible to auto-power on the
 phone, maybe it needs special hardware support, I'm not sure.
 Actually, my phone has this function(not android phone).

 On Jul 23, 12:37 pm, Maps.Huge.Info (Maps API Guru)



 cor...@gmail.com wrote:
  Question:

  If the phone is in a power off condition, how would an app know to
  turn it on?

  -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] Re: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-23 Thread Kaj Bjurman

Sorry to say, but there's a huge flaw in your examples. The snippet
below is taken from your link:

X509EncodedKeySpec keySpec = new X509EncodedKeySpec
(ANDAPPSTORE_APP_KEY);
KeyFactory factory = KeyFactory.getInstance(RSA);
PublicKey key = factory.generatePublic(keySpec);
Cipher cipher = Cipher.getInstance(RSA/ECB/PKCS1Padding);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] original = cipher.doFinal(LICENSE);

Properties props = new Properties();
props.clear();

ByteArrayInputStream bis = new ByteArrayInputStream(original);
try {
  props.load(bis);
} finally {
  bis.close();
}

Very few classes are using using e.g X509EncodedKeySpec, so it's very
easy to find all classes that are using it, and it's thus very easy to
find that section of code. Now replace all operands in the class file
with no operation instead, except this part:

Properties props = new Properties();

I.e. we are creating an empty license.

Now read all your other code snippets with this in mind.

E.g.

4(c)(i). Testing the phone number

String licensePhoneNumber = license.getProperty(p);
if( licensePhoneNumber != null ) {   //Uh, uh. An empty license
returns null, we won't do any checks.

  TelephonyManager TelephonyMgr =
  (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

  String devicePhoneNumber = TelephonyMgr.getLine1Number();

  if(licensePhoneNumber.equals(devicePhoneNumber) == false) {
throw new RuntimeException(** Phone Number Check Failed **);
  }
}

Remember that license now is an empty instance of Properties. The code
above will say that it is a valid license, and so will all of your
other tests as well.




On 23 Juli, 12:11, Al Sutton a...@funkyandroid.com wrote:
 We don't provice jars specifically for this reason.

 The code to decode a license is less than 15 lines long and uses
 standard java classes (i.e. nothing specific to the system or even to
 Android). The code to test license properties is less than 10 lines
 and again uses only java classes. You can see the code 
 athttp://andappstore.com/AndroidApplications/licensing_4.jsp

 This means that each application would need to go through a full
 track, crack, and re-compile cycle (which as others have said is non-
 trivial and takes a fair amount of time), and developers are free to
 move the decrypt/test code around between versions of their app which
 would then require another full track, crack, and re-compile cycle
 before the new version could be made available, which, for a 99c app,
 is not going to be worth the effort for most crackers.

 This part is security by obscurity but it's layered in with secure
 cryptography in the license as an addition measure to make cracking
 harder than if we distributed pre-build jars which a cracker could
 swap out.

 Al.

 On Jul 23, 7:24 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Case 2 doesn't hold. It's still a bit of security by obscurity.
  There are several ways to remove what you describe. One way would be
  to run the program in the emulator/debugger and see where it fails.
  Then check what that method does and correct the logic. Run it again
  in the emulator to see if it still fails, then patch the next place.
  This is usually how programs written in other languages are cracked.
  (E.g. written i C/C++). Cracking in those cases is usually done in a
  debugger for assembler.

  What I described in the scenario above is where they aren't using any
  code from you.
  I don't know what your code look like, or what it does. But I still
  guess that you have classes that others can use. It's in that case
  pretty easy to stub those classes out, and cracking all programs in
  your market would in that case mean that they just have to find out
  how your protection works, stub out code from you, and then apply it
  to all programs.

  Note that I'm not a hacker/cracker, but I'm curious, and I have myself
  tried to protect programs.

  On 22 Juli, 19:58, Al Sutton a...@funkyandroid.com wrote:

   That form of approach is one of the main reasons the AndAppStore
   system can download an encrypted license to the device which can be
   stored and decrypted as neccessary. This means developers can;

   1) Occasionally check the license is still valid by retrying to
   download it, and if it doesn't download due to a network/server error
   the app can use the locally cached copy.

   2) Because the client code is open developers can embed it wherever
   they want in their program logic as opposed to being a single library
   which can be stripped out and replaced with an always return true
   version.

   3) Detect spoof servers because a spoof server will be unable to
   return a properly encrypted file and thus developers can detect
   decryption errors and mark them as spoofing attempts.

   Al.

   On Jul 22, 6:50 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:

Correct, Removing the part that makes the requests, and just return
true is what people usually are doing.

On Jul 22, 5:01

[android-developers] Re: Is there a way to auto-power on the phone?

2009-07-23 Thread Kaj Bjurman

No, as some one previously said. You can set an alarm. Turn off the
SonyEricsson, or Nokia phone. Remove the battery, insert the battery
again. Leave the phone off, and it will turn on when the alarm is
set.



On 23 Juli, 11:22, Yuri Ammosov - Sadko Mobile y...@sadko.mobi
wrote:
 I think you are trying to say coming out of standby mode rather than
 power on.

 On Jul 23, 11:15 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  All my SE phones have been able to turn on themself if I had an alarm
  set, and the phone was turned off. My Android phone (HTC Magic) can
  however not do that. The support is there in Linux, so I don't know it
  this is a hardware thing, or a missing feature in Android.

  On 23 Juli, 07:42, quill quill...@163.com wrote:

   The app is only for users to set time when to turn on the phone or
   power off. How to turn on the phone when it is power off? If we power
   off our phone or take out battery, the clock still show us a correct
   time when we power it on. And the alarm clock also works when we power
   off the phone. So I think it is also possible to auto-power on the
   phone, maybe it needs special hardware support, I'm not sure.
   Actually, my phone has this function(not android phone).

   On Jul 23, 12:37 pm, Maps.Huge.Info (Maps API Guru)

   cor...@gmail.com wrote:
Question:

If the phone is in a power off condition, how would an app know to
turn it on?

-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] Re: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-23 Thread Kaj Bjurman

Shouldn't the code on the page say that in that case, and it's still
very easy to spoof. Replace the code that downloads the certificate
and encrypts it with code that does this:

Properties license = new Properties();
license.put(p, TelephonyMgr.getLine1Number());
license.put(d, Settings.System.getString(getContentResolver(),
Settings.System.ANDROID_ID);
license.put(e, aDateInTheFuture);
..
..

and so on.

I think you get the point. We have enabled all settings. Remember I'm
not a hacker/cracker and I have already shown you that it's very easy
to crack your system. You aren't protecting the code. Applications
will still be pirated very easy, and it's even possible to write an
application that does it automatically.
Users of the applications will also be very frustrated if they for
some reason can't contact your license servers, so the value that you
are adding is about zero.




On Jul 23, 5:38 pm, Al Sutton a...@funkyandroid.com wrote:
 And doing what you say should cause the application to operate as if
 no license is present (i.e. demo mode).

 The demo code is to cover all bases for all types of license where the
 properties in the license are unknown. If you know that you'll be
 using a specific license property your app should enter demo mode if
 that property isn't present.

 Al.

 On Jul 23, 1:45 pm, Kaj Bjurman kaj.bjur...@gmail.com wrote:



  Sorry to say, but there's a huge flaw in your examples. The snippet
  below is taken from your link:

  X509EncodedKeySpec keySpec = new X509EncodedKeySpec
  (ANDAPPSTORE_APP_KEY);
  KeyFactory factory = KeyFactory.getInstance(RSA);
  PublicKey key = factory.generatePublic(keySpec);
  Cipher cipher = Cipher.getInstance(RSA/ECB/PKCS1Padding);
  cipher.init(Cipher.DECRYPT_MODE, key);
  byte[] original = cipher.doFinal(LICENSE);

  Properties props = new Properties();
  props.clear();

  ByteArrayInputStream bis = new ByteArrayInputStream(original);
  try {
    props.load(bis);

  } finally {
    bis.close();
  }

  Very few classes are using using e.g X509EncodedKeySpec, so it's very
  easy to find all classes that are using it, and it's thus very easy to
  find that section of code. Now replace all operands in the class file
  with no operation instead, except this part:

  Properties props = new Properties();

  I.e. we are creating an empty license.

  Now read all your other code snippets with this in mind.

  E.g.

  4(c)(i). Testing the phone number

  String licensePhoneNumber = license.getProperty(p);
  if( licensePhoneNumber != null ) {   //Uh, uh. An empty license
  returns null, we won't do any checks.

    TelephonyManager TelephonyMgr =
        (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

    String devicePhoneNumber = TelephonyMgr.getLine1Number();

    if(licensePhoneNumber.equals(devicePhoneNumber) == false) {
      throw new RuntimeException(** Phone Number Check Failed **);
    }

  }

  Remember that license now is an empty instance of Properties. The code
  above will say that it is a valid license, and so will all of your
  other tests as well.

  On 23 Juli, 12:11, Al Sutton a...@funkyandroid.com wrote:

   We don't provice jars specifically for this reason.

   The code to decode a license is less than 15 lines long and uses
   standard java classes (i.e. nothing specific to the system or even to
   Android). The code to test license properties is less than 10 lines
   and again uses only java classes. You can see the code 
   athttp://andappstore.com/AndroidApplications/licensing_4.jsp

   This means that each application would need to go through a full
   track, crack, and re-compile cycle (which as others have said is non-
   trivial and takes a fair amount of time), and developers are free to
   move the decrypt/test code around between versions of their app which
   would then require another full track, crack, and re-compile cycle
   before the new version could be made available, which, for a 99c app,
   is not going to be worth the effort for most crackers.

   This part is security by obscurity but it's layered in with secure
   cryptography in the license as an addition measure to make cracking
   harder than if we distributed pre-build jars which a cracker could
   swap out.

   Al.

   On Jul 23, 7:24 am, Kaj Bjurman kaj.bjur...@gmail.com wrote:

Case 2 doesn't hold. It's still a bit of security by obscurity.
There are several ways to remove what you describe. One way would be
to run the program in the emulator/debugger and see where it fails.
Then check what that method does and correct the logic. Run it again
in the emulator to see if it still fails, then patch the next place.
This is usually how programs written in other languages are cracked.
(E.g. written i C/C++). Cracking in those cases is usually done in a
debugger for assembler.

What I described in the scenario above is where they aren't using any
code from you.
I don't know what your code look like

[android-developers] Re: Widget bug, is there a work around?

2009-07-22 Thread Kaj Bjurman

I would really like to see this bug fixed. I do also have to change my
code so that I don't have a configuration option when the widget is
added, and then tell the user to configure it before it can work :(



On 26 Maj, 20:36, Tom Gibara m...@tomgibara.com wrote:
 Second time round I got it, thanks :)

 I might try adopting that. It also has the advantage of avoiding another
 similar issue where cancelling the configuration activity leaves a lingering
 widget.

 For my widget I really need the user to configure it before use, but I don't
 like the idea of automatically throwing up an activity in response to a
 broadcast. I might try removing the config activity as you suggest but
 instead invite the user to tap on the widget to initiate configuration.

 Tom

 On May 26, 2009 6:12 PM, AndroidApp zl25dre...@gmail.com wrote:

 you can set a initial layout that says something like 'loading...'
 the point is always drop the widget on the home screen regardless the
 config was successful.

 On May 26, 11:54 am, Tom Gibara m...@tomgibara.com wrote:  How does this
 address the OP's issue?...

  2009/5/26 AndroidApp zl25dre...@gmail.com
  This is what I am doing, it doesnt fix the problem but it

 mitigates   it:Dont bot...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dynamically change widget background

2009-07-22 Thread Kaj Bjurman

Did you find a solution to this?

On 4 Juli, 13:52, Francois DESLANDES kox...@gmail.com wrote:
 Hello everybody,

 I am working a widget…

 I'd like to change my widget background image dynamically, is it possible ?

 I tried theme  style, it doesn't want to work. It doesn't show any
 background image (see code sample below)

 I tried RemoteViews.setImageViewResource on an ImageView filling the widget,
 but i doesn't strech my 9patch image correctly (and it doesn't seems to
 change background, it add another image).

 Is there a solution ?

 Additionnal question : is it possible to use an external (sdcard) 9patch
 image as background ? if yes : how ?

 Thanks

 My test with Themes :

 -

 layout.xml

 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;

 android:id=@+id/widget

 android:layout_width=wrap_content

 android:layout_height=wrap_content

 android:focusable=true

 style=?attr/widgetBackground



 

 -

 attrbs.xml

 resources

 attr name=widgetBackground format=reference /

 /resources

 -

 styles.xml

 resources

 style name=ThemeKxDark parent=@android:style/Theme

 item name=widgetBackground@style/blackBackground/item

 /style

 style name=ThemeKxLight parent=@android:style/Theme

 item name=widgetBackground@style/whiteBackground/item

 /style

 style name=whiteBackground

 item name=android:background@drawable/widget_bg_normal_white/item

 /style

 ...

 -

 widget code

 public void onUpdate(Context context, AppWidgetManager appWidgetManager,
 int[] appWidgetIds) {

 // If no specific widgets requested, collect list of all

 if (appWidgetIds == null) {

 appWidgetIds = appWidgetManager.getAppWidgetIds(new ComponentName(context,
 LargeAppWidget.class));

 }

 context.setTheme(R.style.ThemeKxLight);

 // Request update for these widgets and launch updater service

 UpdateService.requestUpdate(appWidgetIds);

 context.startService(new Intent(context, UpdateService.class));



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



[android-developers] Re: GPS still not working on emulator with r3

2009-07-22 Thread Kaj Bjurman

I'm using 1.5 r2 and r3, and I telnet to the emulator, and then issue
geo fix lng lat. It works, but I have to do it everytime I restart the
emulator. Do also note that the first command that you issue in the
telnet session gets ignored.


On 22 Juli, 01:16, Brian Conrad brianjto...@gmail.com wrote:
 Thanks.  Are you saying that the geo fix command isn't working anymore?  
 And from the DDMS console I sent coordinates but it didn't help either.  
 All I had to do using 1.1 was use the geo fix command and the emulator
 used those coordinates. And yes GPS is enabled in the emulator settings

 - Brian Conrad
 .

 Maps.Huge.Info (Maps API Guru) wrote:



  Until you send it a location with DDMS, the location will be null.
  After you send it, everything works as expected. No altitude, speed,
  bearing or any of the GpsStatus comes across though. It would be nice
  if these things were also accessible in DDMS.

  -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] Re: sql query

2009-07-22 Thread Kaj Bjurman

Do you need to use the content provider? Can't you access a database
directly, or do you need to share the data?





On 22 Juli, 15:42, mahantesh Hunagund mahantesh.t...@gmail.com
wrote:
 Hi ,

 I wanted to remove duplicates from the database. In my db duplication
 can be defined by combination of multiple columns.
 For example :

 _id      kind      type   Pid    name
 1         1           1        3       aaa
 2         1           2        3       aaa
 3         1           1        3       aaa
 4         2           1        3       aaa
 5         4            1        4      bbb

 Here : combination of tuple kind and type make the uniqueness.
  For sample query : get the row for the pid =3 , query should return rows:
 1,2,4

 I can to use distinct clause in my sql query.  Can anyone tell me how to
 specify distict clause in query  provided by android content provider? I
 didn't understand selection and selectionArgs
 field for android query exposed by content provider.

 If I opt for writting rawQuery how to specify projection and URI ?

 Thanks,
 Mahantesh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-22 Thread Kaj Bjurman

I couldn't find much documentation on the site, but it doesn't look
like it will stop piracy, only make it a bit harder. Once you get hold
of the apk file, just modify it so that it isn't using slidelock any
longer.


On 22 Juli, 16:07, John Smith deltafoxtrot...@gmail.com wrote:
 2009/7/22 Moto medicalsou...@gmail.com



  Sorry but I'm very mad about this situation!  I found one of my
  applications on the web all over for free! Every time I do an update 1
  day goes by and BAM! For free on the web...

 Yes, Google's brilliant solution to protecting apps on phones is stupid and
 only ends up crippling the phones.

 If you want to really protect your apps you could use something like
 slidelock...

 http://slideme.org/slidelock

 SlideLock uses cryptography and server based licensing checks to enforce
 proper protection for apps.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-22 Thread Kaj Bjurman

 It's a fact of life, alas. Every piece of software is pirated. I just
 hope that most people think that 99 cents or a couple of bucks is not
 worth getting a pirated version.

Well said. Piracy will always exist. Our task, as a developer, is to
create something that is so good so that people want to pay for it.

Many developers think that people would pay for the application if
they couldn't find a pirate version of it. That is probably not true.
They are using it just because they found it for free. They would
probably keep looking for a free alternative program if they hadn't
found the free version of your application.




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



[android-developers] Re: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-22 Thread Kaj Bjurman

Most games/applications that gets cracked use the same copy
protection. It takes some time to crack the first software, the rest
of them is just a walk in the park.



On Jul 22, 5:24 pm, John Smith deltafoxtrot...@gmail.com wrote:
 2009/7/23 Micah mi...@ourmailbox.net



  A while back Alias|Wavefront (now AutoDesk) tried the licensing server
  thing.  If I'm not mistaken they even had a hardware token required to
  run their application and it still got cracked.  That's an application
  that retails for $2000 a box, and they couldn't secure their software
  with a ridiculous amount of DRM.  It's unlikely that a $5 phone app is
  going to do a much better job of things.

 Exactly, people will spend time and effort cracking $2000 apps, they won't
 bother with most 99c apps. I bet they cracked the app, not the licensing
 server unless the licensing server was all plain text transfers.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ALL DEVELOPERS PIRATED APPLICATION ALL OVER!

2009-07-22 Thread Kaj Bjurman

Correct, Removing the part that makes the requests, and just return
true is what people usually are doing.


On Jul 22, 5:01 pm, Micah mi...@ourmailbox.net wrote:
 The pirates will either strip out the licensing requests from the
 application or they will spoof a licensing server.  Meanwhile, your
 legitimate users can't use your application when they don't have
 access to the licensing server (it's down, they don't have internet
 access, etc.).

 On Jul 22, 7:55 am, Android Development indodr...@gmail.com wrote:



  Maybe an activation licensing key for each binary may be the solution for
  this. But then again, its easier said than done.

  On Wed, Jul 22, 2009 at 8:20 PM, Moto medicalsou...@gmail.com wrote:

   I know that piracy will never end, I mean I'm a solo developer trying
   to fight a war that multi-million companies have spent many millions
   on protecting their content and still they get pirated...

   Well yes there could be some ugly side effect if google adds more anti-
   pirating features, so I guess I'm not too much for that...  But I
   believe there could be a better Android Market system that allows
   anyone with a phone to purchase an app and put it on their SDcard.
   Why not do the following?

   1. User purchases app via Android Market.
   2. Phone sends unique ID IME? to server.
   3. Android Market server prepares application with encryption
   according to given phone information.
   4. Application downloads to phone. put it anywhere, SD card.. etc...
   5. Application only installs on the correct phone.

   I know this method would soon or later be hacked but it's a better way
   than current methods, since we still have those faulty Android version
   that allow rooting..

   -Jona
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Unable to write text file to sdcard on physical G1 device

2009-07-16 Thread Kaj Bjurman

What is file_name set to? Does it also include a path to the sdcard?


On 13 Juli, 23:53, doubleminus doublemi...@gmail.com wrote:
 Romain is?  I don't understand. Is there something I should be doing
 to avoid filenotfound exception?

 On Jul 13, 12:40 am, 郑伟 loveheaven_zheng...@hotmail.com wrote:



  You are right...

   Date: Sun, 12 Jul 2009 21:29:28 -0700
   Subject: [android-developers] Re: Unable to write text file to sdcard on  
   physical G1 device
   From: romain...@google.com
   To: android-developers@googlegroups.com

   Hi,

   Instead of:

FileOutputStream file_out = openFileOutput
(file_name,MODE_WORLD_READABLE);

   Just use:

   FileOutputStream file_out = new FileOutputStream(file_name);

   This should work.

   On Sun, Jul 12, 2009 at 8:10 PM, doubleminusdoublemi...@gmail.com wrote:

I need to write a fairly simple .csv file to the device's sdcard (so
it can then be emailed via Intent). The below code does not write the
file.

File file1 = new File(Environment.getExternalStorageDirectory(),
file_name);
FileOutputStream file_out = openFileOutput
(file_name,MODE_WORLD_READABLE);
BufferedOutputStream buf = new BufferedOutputStream(file_out);
OutputStreamWriter out_stream = new OutputStreamWriter(buf);

 // write fields in first row of spreadsheet then a new line
 for (int i = 0; i  FIELDS.length; i++)
 {
if (i != FIELDS.length - 1)
   out_stream.write(FIELDS[i] + ,);
else
   out_stream.write(FIELDS[i]);
 }

 out_stream.write(\n);

// more code here

I flush and close out_stream. I can even seem to be able to read from
the file on the device (printing above output, using fileinputstream,
to an edittext.

How can I get to this file on the sdcard?

Thanks!

double

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

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

  _
  MSN 表情魔法书,改变你的对话时代!http://im.live.cn/emoticons/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Unable to write text file to sdcard on physical G1 device

2009-07-16 Thread Kaj Bjurman

I can't see that you are using file1 after that line. You are using
file_name.


On 14 Juli, 18:09, doubleminus doublemi...@gmail.com wrote:
 Isn't that what the first lines of code do?

 File file1 = new File(Environment.getExternalStorageDirectory(),
 file_name);

 On Jul 13, 3:02 pm, Streets Of Boston flyingdutc...@gmail.com wrote:



  Simple. :-)
  The error says that the file does not exist... that means you should
  create it.
  Use File#createNewFile().

  On Jul 13, 5:53 pm, doubleminus doublemi...@gmail.com wrote:

   Romain is?  I don't understand. Is there something I should be doing
   to avoid filenotfound exception?

   On Jul 13, 12:40 am, 郑伟 loveheaven_zheng...@hotmail.com wrote:

You are right...

 Date: Sun, 12 Jul 2009 21:29:28 -0700
 Subject: [android-developers] Re: Unable to write text file to sdcard 
 on  physical G1 device
 From: romain...@google.com
 To: android-developers@googlegroups.com

 Hi,

 Instead of:

  FileOutputStream file_out = openFileOutput
  (file_name,MODE_WORLD_READABLE);

 Just use:

 FileOutputStream file_out = new FileOutputStream(file_name);

 This should work.

 On Sun, Jul 12, 2009 at 8:10 PM, doubleminusdoublemi...@gmail.com 
 wrote:

  I need to write a fairly simple .csv file to the device's sdcard (so
  it can then be emailed via Intent). The below code does not write 
  the
  file.

  File file1 = new File(Environment.getExternalStorageDirectory(),
  file_name);
  FileOutputStream file_out = openFileOutput
  (file_name,MODE_WORLD_READABLE);
  BufferedOutputStream buf = new BufferedOutputStream(file_out);
  OutputStreamWriter out_stream = new OutputStreamWriter(buf);

   // write fields in first row of spreadsheet then a new line
   for (int i = 0; i  FIELDS.length; i++)
   {
  if (i != FIELDS.length - 1)
 out_stream.write(FIELDS[i] + ,);
  else
 out_stream.write(FIELDS[i]);
   }

   out_stream.write(\n);

  // more code here

  I flush and close out_stream. I can even seem to be able to read 
  from
  the file on the device (printing above output, using 
  fileinputstream,
  to an edittext.

  How can I get to this file on the sdcard?

  Thanks!

  double

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

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

_
MSN 表情魔法书,改变你的对话时代!http://im.live.cn/emoticons/-Hidequoted 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] Home screen widgets and menu?

2009-07-14 Thread Kaj Bjurman

Hi,

I'd like to know what the prefered way is when it comes to associating
a menu with a home screen widget? I guess that it can't have an option
menu, since it isn't an activity, and that it can't have a context
menu since press-and-hold is used to move a home screen widget.

What to do? Click on my widget currently opens upp a dialog that
displays detailed information, and I would really like to have that on
click. I guess I could display a menu there instead, and then let the
user click in that menu in order to view details, but I don't like the
fact that the user in that case has to click twice.

Regards
Kaj

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Layout editor in Eclipse crashes frequently?

2009-07-12 Thread Kaj Bjurman

Hi,

I have been trying to google, and search this forum, in order to find
out if the layout editor in Eclipse crashes frequently for other
developers as well. Didn't find much but I can't be the only one with
huge problems? I have tried to use the Eclipse plugin in both Ganymede
and Galileo (on a machine with 64-bit version of Vista), and both of
them crash at least once every 30 minutes if I'm editing layout xml-
files.

Is this a well known problem? What to do in order to be able to edit
layout files without crashes?

Thanks
Kaj

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

2009-07-01 Thread Kaj Bjurman

Doesn't apple have a multitouch patent?

On 1 Juli, 00:15, CraigsRace craig...@gmail.com wrote:
 So the latest Android phone now officially has multi-touch support.
 Ref:  http://shop.orange.co.uk/mobile-phones/htc-hero-in-graphite

 I know it is not a Google Experience phone, however, can we please now
 have multi touch support in the SDK?  please!  :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: HTC Hero has multi-touch. SDK support?

2009-07-01 Thread Kaj Bjurman

The patent is for usage on touch screens. The patent was filed in
2008:

http://mashable.com/2009/01/26/apple-multi-touch-patent/


On 1 Juli, 09:13, John Smith deltafoxtrot...@gmail.com wrote:
 2009/7/1 Kaj Bjurman kaj.bjur...@gmail.com



  Doesn't apple have a multitouch patent?

 Was this before or after laptops started having touch pads that are
 multitouch compatible?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: HTC Hero has multi-touch. SDK support?

2009-07-01 Thread Kaj Bjurman

I think it has been granted, and they have probably filed the patent
to other countries as well. (But companies can still license it from
apple)

On 1 Juli, 21:15, Al Sutton a...@funkyandroid.com wrote:
 The patent, if granted, would only valid in the US, so there are no
 issues that would stop a far eastern OEM producing a device for a non-
 US carrier.

 Al.

 On Jul 1, 2:27 pm, John Smith deltafoxtrot...@gmail.com wrote:



  2009/7/1 CraigsRace craig...@gmail.com

   It's not an error.  Here is a video of the HTC Hero, you can clearly
   see the multi touch support (zooming):
  http://www.adobe.com/devnet/devices/articles/htchero.html

   Back on topic.  Will the Android SDK support multi touch?

  What HTC apps support multi-touch, and is the source available?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: READ_CALENDAR and WRITE_CALENDAR

2009-06-23 Thread Kaj Bjurman

Is there somewhere where we can see when it's scheduled for release?

Several people have told me that they don't like the Calendar widget
since it only displays the next upcoming event. It would be far better
if it could be configured to display the X next upcoming events within
a given horizon. E.g display maximum 5 events, but only if they are
within the next 2 weeks.

I thought it sounded pretty easy to create a widget that did that, but
it's kind of disappointing that it isn't possible right now :(



On 18 Juni, 21:14, Dianne Hackborn hack...@android.com wrote:
 No.  Like I said, this API is not yet public.





 On Thu, Jun 18, 2009 at 2:04 AM, Kaj Bjurman kaj.bjur...@gmail.com wrote:

  Is there a public api for reading the Calendar?

  On 18 Juni, 10:30, Dianne Hackborn hack...@android.com wrote:
   This is not a public API, please don't use it.

   On Thu, Jun 18, 2009 at 1:24 AM, Karima karima.ra...@gmail.com wrote:

Found :http://caustiq.esoteriq.org/nb/

Uri uri = Uri.parse(content://calendar/events);
ContentResolver cr = context.getContentResolver();

ContentValues values = new ContentValues();
values.put(eventTimezone, EST);
values.put(calendar_id, 1); // query content://calendar/calendars
for more
values.put(title, Party over thurr);
values.put(allDay, 0);
values.put(dtstart, dtstart); // long (start date in ms)
values.put(dtend, dtend);     // long (end date in ms)
values.put(description, Bring computers and alcohol);
values.put(eventLocation, ZA WARULDO);
values.put(transparency, 0);
values.put(visibility, 0);
values.put(hasAlarm, 0);

cr.insert(uri, values);

With :

   ...
   uses-permission android:name=android.permission.WRITE_CALENDAR /

   uses-permission android:name=android.permission.READ_CALENDAR /

/manifest

   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com

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

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: READ_CALENDAR and WRITE_CALENDAR

2009-06-18 Thread Kaj Bjurman

Is there a public api for reading the Calendar?


On 18 Juni, 10:30, Dianne Hackborn hack...@android.com wrote:
 This is not a public API, please don't use it.





 On Thu, Jun 18, 2009 at 1:24 AM, Karima karima.ra...@gmail.com wrote:

  Found :http://caustiq.esoteriq.org/nb/

  Uri uri = Uri.parse(content://calendar/events);
  ContentResolver cr = context.getContentResolver();

  ContentValues values = new ContentValues();
  values.put(eventTimezone, EST);
  values.put(calendar_id, 1); // query content://calendar/calendars
  for more
  values.put(title, Party over thurr);
  values.put(allDay, 0);
  values.put(dtstart, dtstart); // long (start date in ms)
  values.put(dtend, dtend);     // long (end date in ms)
  values.put(description, Bring computers and alcohol);
  values.put(eventLocation, ZA WARULDO);
  values.put(transparency, 0);
  values.put(visibility, 0);
  values.put(hasAlarm, 0);

  cr.insert(uri, values);

  With :

     ...
     uses-permission android:name=android.permission.WRITE_CALENDAR /

     uses-permission android:name=android.permission.READ_CALENDAR /

  /manifest

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

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

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



  1   2   >