[android-developers] Re: Proper documentation for SQLite usage missing - I need guidance

2013-04-05 Thread Jan Skarvall
Hi again

I'm still confused about SQLite version(s) in Android, not just that there 
is no reference to the SQLite 3.4.0 documentation in the Android Developer 
site.

The statement that Android ships with SQLite 3.4.0 is still there, see 
http://developer.android.com/reference/android/database/sqlite/package-summary.html
At the same time there are additions to the SQLiteDatabase in API level 11, 
e.g. 
enableWriteAheadLogging()http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#enableWriteAheadLogging%28%29,
 
that hints at level 11 being based on SQLite = 3.7.0, see 
http://www.sqlite.org/wal.html.
Is it really possible that Android have implemented WAL on top of SQLite 
3.4.0?

If not, why is there no information on the Android Developer site that 
specifies that you could rely on using SQLite 3.7.0 syntax when you are 
using level 11 as the minSdkLevel?

Regards
Jan

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




[android-developers] I can't get onLongClick on Button to be passed to enclosing TableRow.

2012-01-27 Thread Jan Skarvall
Hi

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

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

package my.namespace;

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

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

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

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

Jan

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


[android-developers] Does GregorianCalendar use another TimeZone implementation than what is available to an App?

2012-01-24 Thread Jan Skarvall
Hi all

I have discovered a problem with getting correct DST saving value,
.
TimeZone.getDSTSavings() normally returns 360 (1 hour), but should
for timezone ID Australia/Lord_Howe return 180 (30 minutes).
(See http://www.timeanddate.com/worldclock/clockchange.html?n=750)

I believe that GregorianCalendar uses TimeZone.getDSTSavings(), but
that is only my guess from looking at the source at
http://www.java2s.com/Open-Source/Android/android-core/platform-libcore/java/util/GregorianCalendar.java.htm

Now, if I instead of using TimeZone.getDSTSavings() looks att what
GregorianCalendar.get(Calendar.DST_OFFSET) returns, it is infact
180 when DST is on, which the following App reveals:

package x.getdstavingsissue;
/*
 * Result on Android 2.2 is:
 *  TimeZone.getDSTSavings() == 360
 *  GregorianCalendar DST_OFFSET == 180
 */
import java.util.Calendar;
import java.util.TimeZone;

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

public class GetDSTSavingsIssueActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Calendar cal =
Calendar.getInstance(TimeZone.getTimeZone(Australia/Lord_Howe));
int getdstsavings = cal.getTimeZone().getDSTSavings();
cal.set(2012, 1, 1, 0, 0, 0);
cal.set(Calendar.MILLISECOND, 0);
int caldstsavings = cal.get(Calendar.DST_OFFSET);
((TextView) findViewById(R.id.getdstsavings))
.setText(TimeZone.getDSTSavings() ==  +
String.valueOf(getdstsavings));
((TextView) findViewById(R.id.caldstsavings))
.setText(GregorianCalendar DST_OFFSET ==  +
String.valueOf(caldstsavings));
Log.d(GetDSTSavingsIssue, TimeZone.getDSTSavings() ==  +
String.valueOf(getdstsavings));
Log.d(GetDSTSavingsIssue, GregorianCalendar DST_OFFSET ==  +
String.valueOf(caldstsavings));
   }
}

I tried running on 2.2 in emulator and on a device, and also on 3.2 in
emulator. Same result.

So, I wonder how this can be.

Regards
Jan

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


[android-developers] Re: Does GregorianCalendar use another TimeZone implementation than what is available to an App?

2012-01-24 Thread Jan Skarvall
Thanks!

I forgot to include main.xml.

You may either remove the lines:

((TextView) findViewById(R.id.getdstsavings))
.setText(TimeZone.getDSTSavings() ==  +
String.valueOf(getdstsavings));
((TextView) findViewById(R.id.caldstsavings))
.setText(GregorianCalendar DST_OFFSET ==  +
String.valueOf(caldstsavings));

or change res/layout/main.xml to look like below:

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=fill_parent
android:orientation=vertical 
TextView
android:id=@+id/getdstsavings
android:layout_width=fill_parent
android:layout_height=wrap_content/
TextView
android:id=@+id/caldstsavings
android:layout_width=fill_parent
android:layout_height=wrap_content/
/LinearLayout

Also, the line:

cal.set(Calendar.MILLISECOND, 0);

can be deleted. It is irrelevant for the result.

Jan

On Jan 24, 1:13 pm, Mark Murphy mmur...@commonsware.com wrote:
 I know some tricks are played with the time zone database, compared to
 regular Java environments, simply for performance issues. It used to
 be the first time you used something that touched time zones that your
 app would freeze for a full second while the database was loaded. Now,
 they pre-load the time zone database in zygote and share it among all
 VMs. It's possible that there's a bug introduced in that process.

 I would file an issue on this at b.android.com, with a complete
 project containing your source code that demonstrates the error.









 On Tue, Jan 24, 2012 at 6:18 AM, Jan Skarvall jan.skarv...@telia.com wrote:
  Hi all

  I have discovered a problem with getting correct DST saving value,
  .
  TimeZone.getDSTSavings() normally returns 360 (1 hour), but should
  for timezone ID Australia/Lord_Howe return 180 (30 minutes).
  (Seehttp://www.timeanddate.com/worldclock/clockchange.html?n=750)

  I believe that GregorianCalendar uses TimeZone.getDSTSavings(), but
  that is only my guess from looking at the source at
 http://www.java2s.com/Open-Source/Android/android-core/platform-libco...

  Now, if I instead of using TimeZone.getDSTSavings() looks att what
  GregorianCalendar.get(Calendar.DST_OFFSET) returns, it is infact
  180 when DST is on, which the following App reveals:

  package x.getdstavingsissue;
  /*
   * Result on Android 2.2 is:
   *      TimeZone.getDSTSavings() == 360
   *      GregorianCalendar DST_OFFSET == 180
   */
  import java.util.Calendar;
  import java.util.TimeZone;

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

  public class GetDSTSavingsIssueActivity extends Activity {
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         Calendar cal =
  Calendar.getInstance(TimeZone.getTimeZone(Australia/Lord_Howe));
         int getdstsavings = cal.getTimeZone().getDSTSavings();
         cal.set(2012, 1, 1, 0, 0, 0);
         cal.set(Calendar.MILLISECOND, 0);
         int caldstsavings = cal.get(Calendar.DST_OFFSET);
                 ((TextView) findViewById(R.id.getdstsavings))
                 .setText(TimeZone.getDSTSavings() ==  +
  String.valueOf(getdstsavings));
                 ((TextView) findViewById(R.id.caldstsavings))
                 .setText(GregorianCalendar DST_OFFSET ==  +
  String.valueOf(caldstsavings));
                 Log.d(GetDSTSavingsIssue, TimeZone.getDSTSavings() ==  +
  String.valueOf(getdstsavings));
                 Log.d(GetDSTSavingsIssue, GregorianCalendar DST_OFFSET == 
   +
  String.valueOf(caldstsavings));
    }
  }

  I tried running on 2.2 in emulator and on a device, and also on 3.2 in
  emulator. Same result.

  So, I wonder how this can be.

  Regards
  Jan

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

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

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

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

[android-developers] Re: Does GregorianCalendar use another TimeZone implementation than what is available to an App?

2012-01-24 Thread Jan Skarvall
I just reported it, se http://code.google.com/p/android/issues/detail?id=24684

Jan

On Jan 24, 5:33 pm, Jan Skarvall jan.skarv...@telia.com wrote:
 Thanks!

 I forgot to include main.xml.

 You may either remove the lines:

                 ((TextView) findViewById(R.id.getdstsavings))
                 .setText(TimeZone.getDSTSavings() ==  +
 String.valueOf(getdstsavings));
                 ((TextView) findViewById(R.id.caldstsavings))
                 .setText(GregorianCalendar DST_OFFSET ==  +
 String.valueOf(caldstsavings));

 or change res/layout/main.xml to look like below:

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     android:orientation=vertical 
     TextView
         android:id=@+id/getdstsavings
         android:layout_width=fill_parent
         android:layout_height=wrap_content/
     TextView
         android:id=@+id/caldstsavings
         android:layout_width=fill_parent
         android:layout_height=wrap_content/
 /LinearLayout

 Also, the line:

         cal.set(Calendar.MILLISECOND, 0);

 can be deleted. It is irrelevant for the result.

 Jan

 On Jan 24, 1:13 pm, Mark Murphy mmur...@commonsware.com wrote:







  I know some tricks are played with the time zone database, compared to
  regular Java environments, simply for performance issues. It used to
  be the first time you used something that touched time zones that your
  app would freeze for a full second while the database was loaded. Now,
  they pre-load the time zone database in zygote and share it among all
  VMs. It's possible that there's a bug introduced in that process.

  I would file an issue on this at b.android.com, with a complete
  project containing your source code that demonstrates the error.

  On Tue, Jan 24, 2012 at 6:18 AM, Jan Skarvall jan.skarv...@telia.com 
  wrote:
   Hi all

   I have discovered a problem with getting correct DST saving value,
   .
   TimeZone.getDSTSavings() normally returns 360 (1 hour), but should
   for timezone ID Australia/Lord_Howe return 180 (30 minutes).
   (Seehttp://www.timeanddate.com/worldclock/clockchange.html?n=750)

   I believe that GregorianCalendar uses TimeZone.getDSTSavings(), but
   that is only my guess from looking at the source at
  http://www.java2s.com/Open-Source/Android/android-core/platform-libco...

   Now, if I instead of using TimeZone.getDSTSavings() looks att what
   GregorianCalendar.get(Calendar.DST_OFFSET) returns, it is infact
   180 when DST is on, which the following App reveals:

   package x.getdstavingsissue;
   /*
    * Result on Android 2.2 is:
    *      TimeZone.getDSTSavings() == 360
    *      GregorianCalendar DST_OFFSET == 180
    */
   import java.util.Calendar;
   import java.util.TimeZone;

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

   public class GetDSTSavingsIssueActivity extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
          Calendar cal =
   Calendar.getInstance(TimeZone.getTimeZone(Australia/Lord_Howe));
          int getdstsavings = cal.getTimeZone().getDSTSavings();
          cal.set(2012, 1, 1, 0, 0, 0);
          cal.set(Calendar.MILLISECOND, 0);
          int caldstsavings = cal.get(Calendar.DST_OFFSET);
                  ((TextView) findViewById(R.id.getdstsavings))
                  .setText(TimeZone.getDSTSavings() ==  +
   String.valueOf(getdstsavings));
                  ((TextView) findViewById(R.id.caldstsavings))
                  .setText(GregorianCalendar DST_OFFSET ==  +
   String.valueOf(caldstsavings));
                  Log.d(GetDSTSavingsIssue, TimeZone.getDSTSavings() ==  
   +
   String.valueOf(getdstsavings));
                  Log.d(GetDSTSavingsIssue, GregorianCalendar DST_OFFSET 
   ==  +
   String.valueOf(caldstsavings));
     }
   }

   I tried running on 2.2 in emulator and on a device, and also on 3.2 in
   emulator. Same result.

   So, I wonder how this can be.

   Regards
   Jan

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

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

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group

[android-developers] Proper documentation for SQLite usage missing - I need guidance

2011-08-02 Thread Jan Skarvall
Hi all

I have been trying to find reliable documentation for SQLite to use during 
Android app development.

I assume that to be on the safe side I should go for SQLite 3.4.0, as this 
is stated here: 
http://developer.android.com/reference/android/database/sqlite/package-summary.html

The only reference to SQLite documentation I can find on the developer site 
is here: 
http://developer.android.com/guide/topics/data/data-storage.html#dbwhere there 
is a link 
SQLite. http://www.sqlite.org/
Following that link I can only find documentation for the latest version 
(3.7.7.1), not for 3.4.0 (disregarding change notes for each version).
I spent some time Googeling around on the Internet, but I could not find the 
3.4.0 documentation viewable anywhere.

In the end I found a 3.4.0 tarball and built the documentation, but the 
syntax differs from examples in the book Android Wireless Application 
Development, written for Android 2.2.
In that book (on p. 241) there is an example on how to create a foreign key 
and add a constraint using a trigger. In that example, a foreign key is 
defined using syntax like:

a_fk INTEGER NOT NULL CONSTRAINT a_fk REFERENCES another_table(pk) ON DELETE 
CASCADE

The problem is that the definition above uses a syntax that I can not find 
in the 3.4.0 documentation, where the syntax for CREATE TABLE looks like 
below:

CREATE TABLE *sql-command* ::= *CREATE *[*TEMP *|* TEMPORARY*]* TABLE *[*IF 
NOT EXISTS*]* *[*database-name** .*]* **table-name** (
**column-def** *[*, **column-def*]**
*[*, **constraint*]**
)* *sql-command* ::= *CREATE *[*TEMP *|* TEMPORARY*]* TABLE *[*database-name
**.*]* **table-name** AS **select-statement* *column-def* ::= *name** *[*
type*]* *[[*CONSTRAINT **name*]* **column-constraint*]* *type* ::= *typename
** *|*
**typename** ( **number** ) *|*
**typename** ( **number** , **number** )* *column-constraint* ::= *NOT NULL 
*[* **conflict-clause** *]* *|*
PRIMARY KEY *[*sort-order*]* *[* **conflict-clause** *]* *[*AUTOINCREMENT*]* 
*|*
UNIQUE *[* **conflict-clause** *]* *|*
CHECK ( **expr** ) *|*
DEFAULT **value** *|*
COLLATE **collation-name* *constraint* ::= *PRIMARY KEY ( **column-list** ) 
*[* **conflict-clause** *]* *|*
UNIQUE ( **column-list** ) *[* **conflict-clause** *]* *|*
CHECK ( **expr** )* *conflict-clause* ::= *ON CONFLICT **conflict-algorithm*I 
can neither find the REFERENCE nor the DELETE keyword in the syntax 
definition.
I have not found any statement in the book saying which SQLite version it is 
written for, though.

So, I'm not certain if I should go for what's in that book, or use the 3.4.0 
documentation I built, and try to figure out myself how to properly create a 
foreign key, constraint and so on.
I really think, that the android developer site, stating that 3.4.0 is the 
right version, should include, or refer to, full documentation for that 
version.

I really wonder how developers do when they create apps using SQLite. How on 
earth do they know what to (not) use?

Can anyone guide me please?

Regards,

Jan




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

Ang.: [android-developers] Re: How many minutes (hours?) does the LVL hang on Checking license

2011-07-22 Thread jan . skarvall
Hi Jim

Are you showing all license related code that you have in your app above?
If that is the case, I recommend that you read through the chapters in 
http://developer.android.com/guide/publishing/licensing.html once again.

Jan

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

Ang.: Re: [android-developers] Ang.: Re: 2.3 Platform Google APIs missing Licensing Service..?

2011-05-17 Thread jan . skarvall
Yes, I know. The app I tried uses LVL r1 (which is built using Android 1.5, 
level 3) as a library. The app itself is built using Android 2.1 update 1, 
i.e. level 7. I get the error on AVDs running Google APIs level 9, 11, 12, 
but on level 8 licensing works. It is the same .apk file I have been using 
in all cases. I have not tried level 10. Level 7 is out of the question as 
an AVD with Google API level 7 does not support licensing. Same .apk file 
also works fine on real devices running level 7 and 8.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Ang.: Re: 2.3 Platform Google APIs missing Licensing Service..?

2011-05-12 Thread Jan Skarvall
Same error on level 12.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Ang.: Re: 2.3 Platform Google APIs missing Licensing Service..?

2011-04-28 Thread Jan Skarvall
I get the same error, can not bind to service on AVD's running level 9 and 
11 of Google API, and that level 8 works. I have not tested level 10.

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