Version of SQLite used in Android? - database

What is the version of SQLite used in Android?
Reason: I'm wondering how to handle schema migrations. The newer SQLite versions support an "ALTER TABLE" SQL command which would save me having to copy data, drop the table, recreate table and re-insert data.

Here is a link to the official docs which include the main points in this answer: android.database.sqlite package-level javadoc
Kotlin code to get framework SQLite version (tip: just stick a breakpoint in your Activity onCreate() and use this code in Evaluate Expression...):
val version = android.database.sqlite.SQLiteDatabase.create(null).use {
android.database.DatabaseUtils.stringForQuery(it, "SELECT sqlite_version()", null)
}
"Framework (API ${android.os.Build.VERSION.SDK_INT}) SQLite version: $version".also { println(it) }
Using the emulators (note, SQLite version on actual devices will be at least that specified):
API level*
Version
Name
SQLite
Notes
33
13
T
3.32.2
32
12L
Sv2
3.32.2
31
12
S
3.32.2
30
11
R
3.28.0
window functions
29
10
Q
3.22.0
28
9
Pie
3.22.0
27
8.1
Oreo
3.19.4
see 3.19.3 and version control check-ins because 3.19.4 link does not exist
26
8.0
Oreo
3.18.2
O beta versions used 3.18.0
25
7.1.1
Nougat
3.9.2
24
7.0
Nougat
3.9.2
23
6.0
Marshmallow
3.8.10.2
M Preview 1 (SDK level 22) used 3.8.10
22
5.1.1
Lollipop
3.8.6.1
see 3.8.6 and version control check-ins because 3.8.6.1 link does not exist
21
5.0
Lollipop
3.8.6
20
4.4W.2
Android Wear
unknown
no emulator available, but probably either 3.7.11 or 3.8.4.3
19
4.4
KitKat
3.7.11
18
4.3
Jelly Bean
3.7.11
17
4.2
Jelly Bean
3.7.11
16**
4.1
Jelly Bean
3.7.11
15
4.0.3
Ice Cream Sandwich
3.7.4
14**
4.0
Ice Cream Sandwich
3.7.4
13
3.2
Honeycomb
3.7.4
12
3.1
Honeycomb
3.7.4
11**
3.0
Honeycomb
3.7.4
10
2.3.3
Gingerbread
3.6.22
9
2.3.1
Gingerbread
3.6.22
8**
2.2
Froyo
3.6.22
7
2.1
Eclair
3.5.9
4
1.6
Donut
3.5.9
3**
1.5
Cupcake
3.5.9
* Android API level links show where the android.database.sqlite package has changed. Where there is no link (e.g. API level 17), indicates no changes to that package.
** Broken SDK link, see here
Note: if you want your app to use the same version of SQLite across all Android versions, consider using Requery's 3rd party SQLite support library or SQLCipher (if you also want encryption).

Although the documentation gives 3.4.0 as reference number, if you execute the following sql, you'll notice that there is a much higher number of SQlite installed:
Cursor cursor = SQLiteDatabase.create(null).rawQuery("select sqlite_version() AS sqlite_version", null);
String sqliteVersion = "";
while(cursor.moveToNext()){
sqliteVersion += cursor.getString(0);
}
This is just a piece of quick, dirty code to retrieve the sqlite version. For instance on a HTC Hero with Android 2.1, I get: 3.5.9.
On my Nexus One with Android 2.2, I even get 3.6.22.

$ adb shell sqlite3 --version
3.5.9
Same on ADP1 1.6 & 2.1 emulator.

A short overview of the Andorid APIs and the supported SQLite versions.
The overview is from the link in Mark Carters answer.

In Room you can query
SELECT sqlite_version()
RG

Related

Why there is no version 6.0.0 final of Microsoft.Win32.Registry nuget package?

The latest version of the Microsoft.Win32.Registry package is 6.0.0-preview.5.21301.5 released on 15th June 2021 and there is no .NET 7.0 preview version as well. However the Microsoft doc explains that the class Microsoft.Win32.Registry is available for .NET 6.0 and .NET 7.0 preview in the assembly Microsoft.Win32.Registry.dll.
The package System.Security.Principal.Windows has exactly the same versioning issue while the doc says that the class System.Security.Principal.WindowsPrincipal is available for .NET 6.0 and .NET 7.0 preview in the assembly System.Security.Principal.Windows.dll.
On the other hand the package System.Management for example is available for .NET 6.0 and .NET 7.0 preview.
What is happening with Microsoft.Win32.Registry and System.Security.Principal.Windows packages?
For Microsoft.Win32.Registry change your target framework to net6.0-windows - as answered in this discussion:
You shouldn't need an extra package. If you set <TargetFramework>net6.0-windows</TargetFramework> in your .csproj, you should get access to those types.

Codename one version 1.0 is installed even though I install version 6.0 from Eclipse Marketplace

I am using Eclipse 2020-06 (I have made a fresh install of Eclipse instead of upgrading it from an earlier version of Eclipse) and JDK 8 (1.8.0_261). My OS is Windows 10.
JAVA_HOME is set to C:\Program Files\Java\jdk1.8.0_261
When I download "Codename One" plugin from Eclipse Marketplace it shows the version as 6.0 and it says "Installed" at the end of the installation process.
However, when I go to "Help -> Eclipse IDE -> Installation Details" under Eclipse, CodenameOneFeature version is listed as: 1.0.0.201409151325
When I select CodenameOneFeature from this list and hit Update, it says "No updates found". So basically I cannot force it to update to 6.0.
I can confirm that I have the earlier version installed also from the setting of the Codename One projects I create: when I go to Properties -> Java Compiler, the compliance level is set to 1.5 (also 1.5 is used in build.xml file).
BTW, I have also tried installing Eclipse 2019-06 (instead of 2020-06) and/or installing JDK 10 (instead of JDK 8) and/or modifying the eclipse.ini (by adding -vm option) so that it uses the version of JDK I want (instead of setting JAVA_HOME). But no combination of those has solved the problem.
Updated answer:
I found the problem. I broke the update site with a commit a couple of weeks ago. This should be fixed in a couple of hours once server caches refresh.
Original answer:
With Eclipse at this time we only support JDK 8. We're experiencing issues in updating the eclipse plugin to the latest version. Once installed I think you can also use JDK 11 but it doesn't matter since we don't support JDK 11 features.
Once a reasonably new version of the plugin is installed you can press update in Codename One Settings and it will update our libraries to the latest version equivalent to the other IDEs.

GeneXus 15 + Google Cloud Deployment Error: Class file is Java 8 but max supported is Java 7

I have seen many answers in these forum, but none related to GX so far, and the ones I've tried haven't solved this issue.
When trying to deploy a GX 15 + JAVA + Web + Mobile I get the following error:
...
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109\WEB-INF\classes\com\proyecto02\gamcheckuseractivationmethod.class
Unable to update app: Class file is Java 8 but max supported is Java 7: C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109\WEB-INF\classes\com\proyecto02\gamcheckuseractivationmethod.class
error: C:\GeneXus\GeneXus15\DeploymentTargets\GoogleAppEngine\deploy.msbuild(4,3): error MSB3073: The command ""C:\android\engine\appengine-java-sdk-1.9.51\bin\appcfg.cmd" -A proyecto02 update "C:\modelos\pruebagoogle\Deploy\JavaModel\GAE\20170422042109" -V 3" exited with code 1.
Done Building Project "C:\GeneXus\GeneXus15\DeploymentTargets\GoogleAppEngine\deploy.msbuild" (Deploy target(s)) -- FAILED.
...
To build mobile apps GX 15 requires JDK 8.
Has anyone been able to deploy to Google Cloud?
Any suggestions to solve the error?
GeneXus Java generator does not require Java 8, it requires Java 6 or higher, Genexus Android generator requires Java 8.
Each generator has independent properties to set the JDK to be used, compiler options, etc. So, no matter you are using JDK 8 you are able to set "Java compiler options" (for Java Generator) as: -O -source 1.7 -target 1.7 in order to compile the application to run on 1.7 JVM (as explained here)
Another solution is to have both JDKs installed, to set JDK 1.7 path as Java Generator/Compiler path and JDK 1.8 path as Android/Compiler Path.

Unsupported major.minor version 51.0

I'm developing with CodenameOne in the IntelliJ IDE. When I choose "Send MacOS Desktop Build", I get this error message:
Unsupported major.minor version 51.0
My project SDK says 1.5 (Java Version 1.6.0_65)
My Language level is set to 5.0
I've done a rebuild, which should recompile everything, but I still get this error. Version 51 refers to Java 7. Can anyone tell me how to fix this?
Does your project have any 3rd party cn1libs? It is possible some of them have been compiled with Java 7.
A workaround in that case would be to change your project to use Java 8. (I think that is supported in IntelliJ, but not 100% sure). For changing the project to Java 8 there are a few settings you need to change. It is usually just easier to start a new project and check "Java 8" in the wizard. Then copy your sources over.
Please find the list of major minor version related issue.
J2SE 8 = 52,
J2SE 7 = 51,
J2SE 6.0 = 50,
J2SE 5.0 = 49,
JDK 1.4 = 48,
JDK 1.3 = 47,
JDK 1.2 = 46,
JDK 1.1 = 45
We can change the required compatible JDK Version from Configuration Page and it should work out.
This is a problem because we require a minimum of JDK 1.7 and now recommend JDK 8. You need to set IntelliJ to use that JDK and configure it to use it.
I had this issue while running cxf soap client.
Server: apache-tomcat-7.0.33
Error: java.lang.UnsupportedClassVersionError: org/apache/cxf/jaxws/JaxWsProxyFactoryBean :
Unsupported major.minor version 51.0
Resolution: Resolved this by compiling the app using jdk1.8.0_65. Earlier i was using jdk1.7.

Flex 4.1 installed on a Mac: how do I target pre-version 10 flash players

I just installed (or copied) the Flex SDK 4.1 on my Mac to:
/Developer/SDKs/Flex/4/1/
For now I'll only be using a plain text-editor to use it. No fancy IDE.
However, it only seems to support flashplayers version 10 and 10.1. At least that's what it looks like from the folders:
./frameworks/libs/players/10.0/
./frameworks/libs/players/10.1/
I thought I was being smart and copied the version 9 swc from the SDK 3.4 to:
./frameworks/libs/players/9/
I also copied the flex-config.xml from the SDK 3.4 and renamed it.
When I tried to compile it with the SDK 4.1 by using the -load-config options however, it still complained about certain dependencies that were not found:
// Error: Type not found or no constant at compilation. Matrix3D.
Fout: Type niet gevonden of geen constante bij compilatie. Matrix3D.
/Developer/SDKs/Flex/4/1/frameworks/libs/flash-integration.swc(mx.utils:MatrixUtil)
So, I thought about copying flash-integration.swc also. But then I thought: before I go any further with tweaking the contents of the SDK 4.1 let's ask SO whether what I intend to do is even possible. Is it? Is it possible to target player 9 for instance with SDK 4.1?
Flex 4 and above requires Flash Player 10 or highr. It makes use of some 10 specific features, such as the new text engine. If you want to target 9 you'll have to use Flex 3.5 or lower.

Resources