Hi dear community
I have tried to use Openfl and Sqlite but it just worked in neko output and when I tried to get an android output build process failed just after it started please help me on this here is my code and project.xml
///////////////////////main.hx//////////////////////
package;
import openfl.display.Sprite;
import openfl.Lib;
import openfl.text.TextField;
import sys.db.Sqlite;
import sys.db.Manager;
import sys.db.Connection;
import sys.db.TableCreate;
#if android
import hxcpp.StaticSqlite;
#end
/**
-
…
-
@author
*/
class Main extends Sprite
{
var tx:TextField=new TextField();
public function new()
{
super();
tx.text = “this is a sqlite test\n”;
addChild(tx);
tx.x = 200;
tx.y = 200;
show();
// Assets:
// openfl.Assets.getBitmapData(“img/assetname.jpg”);}
public function show(){
var cnx = Sqlite.open(“test.db”);
cnx.request(“CREATE TABLE IF NOT EXISTS User (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT,age INTEGER,money DOUBLE)”);
cnx.request(“INSERT INTO User (name,age,money) VALUES (‘John’,32,100.45)”);
cnx.request(“INSERT INTO User (name,age,money) VALUES (‘Bob’,14,4.50)”);
var rset = cnx.request(“SELECT * from User”);
for(row in rset){
tx.text += “name is” + row.name+"\n";
}
cnx.close();
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////project.xml///////////////////////////
<?xml version="1.0" encoding="utf-8"?><!-- metadata, make sure 'package' is at least 3 segments (ie. com.mycompany.myproject) -->
<meta title="sqlite1" package="sqlite1.com.as" version="1.0.0" company="" />
<!-- output -->
<app main="Main" file="sqlite1" path="bin" />
<window background="#ffffff" fps="60" />
<window width="800" height="480" unless="mobile" />
<window orientation="landscape" vsync="false" antialiasing="0" if="cpp" />
<!-- classpath, haxe libs -->
<source path="src" />
<haxelib name="sqlite" />
<haxelib name="hxcpp" />
<haxelib name="openfl" />
<haxelib name="actuate" />
<android target-sdk-version="16" />
<android permission="android.permission.WRITE_EXTERNAL_STORAGE"/>
<android permission="android.permission.WRITE_INTERNAL_STORAGE"/>
<!-- assets -->
<icon path="assets/openfl.svg" />
<assets path="assets/img" rename="img" />
<!-- optimize output
<haxeflag name="-dce full" /> -->
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////