SQLite android NDK - sqlite

I'm trying to use a custom function in sqlite3.
I found no way in Java to do that so I moved on android-ndk, but now
I'm having troubles integrating sqlite3 sources in my project.
Compiler give me an error 'sqlite3_api' was note declared in this
scope.
In my source "sqlite3ext.h" is included (sqlite3 amalgamation is also included in project).
Any suggestion is welcome!

I had similar problems trying to get SQLite with SEE (SQLite Encryption Extensions) to compile and work. In the end I found http://code.google.com/p/sqlite3-android/ (the 2 downloads dated 17th February, the march downloads added some extra complications that didn't do what I wanted)
Once I had that working I included in the see.c with sqlite3.c and soon got it all working.

Related

Still getting ITMS-90809: Deprecated API Usage after using --optimize=force-rejected-types-removal

This has been killing me for the last couple of days. I have read everything I can find on this error and have done what xamarin says but it still doesn't work.
I can't get my builds to get through azure pipeline xamarin.ios build and deploy to apple.
When I build locally I get messages like
MTOUCH : warning MT1502: One or more reference(s) to type 'UIKit.UIWebView' already exists inside 'Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' before linking
with a companion message that says no references after linking
when I use --warn-on-type-ref=UIKit.UIWebView with the optimize arg.
When I build on azure in my pipeline, I only see the MT1502 but nothing saying anything after linking. The build gets submitted to Apple and fails because of the ITMS message.
I don't know what to do. I am using the latest macOS vm image, mono 6.8.0.123, xamarin.ios 13.16.0.13, xcode 11.4.1. The pipeline worked fine before April 30 deadline, now no matter what, I can't get the linker to strip UIWebView.
Let me know what other info would be helpful. I am completely stuck at this point.
Thanks.
I just got my build to pass Apple's inspection.
What ended up working for me was building locally and packaging the ipa file. On my mac I then changed the ipa extension to zip and unzipped it. I used terminal to go to the YOURAPPNAME.app "folder" and used grep -r UIWebView . to search for references. Don't forget the . so it searches the current directory. I missed that at first and got some message that grep was listening on stdin.
For me that resulted in a line like this:
Binary file ./Frameworks/PersonalizedAdConsent.framework/PersonalizedAdConsent matches
Now, the important thing to note is the linker never warned about this, so I was completely unaware of it. In my case it was part of Firebase/Admob. I was only one release behind and updating to the latest fixed my problem.
I still am using --optimize=force-rejected-types-removal --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503 as my mtouch args. But builds now get through.
I hope this helps point you guys in the right direction, I've spent the last 3 days just trying to get builds to upload reading every post I could find on the web on this problem.
Solved !! I had to update the way how nugets are included to the iOS project .csproj file. The problem was that linker despite the --optimize=force-rejected-types-removal flag was not removing the UIWebView component form Xamarin.Forms 4.6 probably because it did not see it.
My project was created over two years ago and I was still using the packages.config file. After the update the flag started to work and grep query returned 0 :). The best way is to compare the old .csproj file with freshly created iOS project .csproj file and see how VS is referencing nugets.

MS-Project-2016 XSD Availability?

I'm trying to import an XML generated in MS Project 2016 into another system, but the XSD I have seems to be from an older version. I've only been able to find it for 2007 and 2010. I can probably tweak what I have to account for the differences, but it would be nice to not have to. Are schema definitions for newer versions of Project available somewhere?
Sadly I'm not sure they exist. I look for updated versions periodically but I haven't come across any yet.
The most recent version I have has the filename mspdi_pj15.xsd, and the comment in the file says Revision date: 2012-07-18. This was extracted from the Project 2013 SDK.
One word of warning is that regardless of MS Project version changes, the XSDs don't match what Project actually reads and writes in a few areas. I use the XSD to generate JAXB code as part of MPXJ, and I've had to make a number of manual revisions to the published XSD to get it work correctly. Unfortunately I'm not sure that publishing the changes is possible as the original file is copyright Microsoft and doesn't mention redistribution.

Static link sqlite in Lazarus

I am building an application with Lazarus where I use a sqlite database to store thousands of records. Right now I am linking to the sqlite library dynamically via the sqlite3.dll.
Is it possible to link to it statically? Where can I find the Lazarus compatible lib file to do that?
Note:
I only started using Lazarus and Free Pascal a month ago so something that might look very obvious to one, might not be for me. So bear with me a bit.
Cheers
Actual static linking is difficult since the TSQLite3Connection component is inherently designed to actively load the SQLite3 DLL. In other words, it's not linking against the library when you compile the program, the component is coded to dynamically load the DLL at run time.
If you are looking to have a totally self contained program, then you can accomplish this two different ways.
Create a new TSQLite3Connection component that links statically against sqlite3 instead of loading the DLL dynamically.
Include the sqlite3.dll as a resource in your program and have your program automatically deploy it before it runs.
Solution #1 is not trivial and not for the faint of heart. I've done it, and I intended to include a link to the component, but the result isn't stable. The problem is that you have to compile a static version of sqlite3, which isn't a real problem, but you have to do it with something like gcc under MinGW and that introduces issues. Compiling with gcc under MinGW means you have to then link in libgcc.a, and because FreePascal's internal linker doesn't know how to interpret stdcall symbols properly, you also have to link against MinGW's libkernel32.a, and libmsvcrt.a. The result just isn't stable. Crashes galore.
Solution #2 should be fairly easy, but the Lazarus maintainers make it a little hard. The part where you store the dll inside the executable as a resource is easy enough to do. And so is writing it out as a temp file. The problem is that you can't tell the TSQLite3Connection component where to find it after. So it looks in the executable's folder, or in system folders. Neither of which can necessarily be written to by the executable. The only place you can guarantee that your program will be able to write to is a temp folder. So what I did is created a new version of TSQLite3Connection component call TSQLite3DynConnection, meaning you can dynamically specify where the DLL is. I made a published property called ClientLibrary where you can specify the location of the dll (it doesn't have to end in .dll, so you can use system temp filename generation routines). You can get this component at: http://icculus.org/~kfitzner/misc/sqlite3dyndll.zip. It will compile against Lazarus 1.6.2 FP 3.0.0, or FP 1.0.6 / FP 2.6.0, which are the two versions I use.
I'll update this answer if I can get the statically linked version stable.
2 Dec 2016 update: I managed to get a static version stable.

GitHub fails to determine the repository language

I use GitHub for a C++ / Qt project. GitHub automatically determines the languages of the project from the file extentions. Problem: Qt has a file name ProjectName.pro, which is interpreted to be Prolog by GitHub.
How can I indicate it is NOT Prolog, but C++ ?
It is actually a known issue: https://github.com/github/linguist/issues/394
It's been submitted 6 month ago but GitHub still doesn't bother fixing it... Do you think of any workaround ?
As said in the original issue (https://github.com/github/linguist/issues/394):
Linguist now supports custom overrides for language definitions and
custom vendor paths
So in order to finally have Qt project files properly recognized as C++ in language statistics, you can add this line in your .gitattributes file.
*.pro linguist-language=C++
See https://github.com/github/linguist#overrides for more details.

Using SQLite with Rubymotion

I want to use the C-level SQLite API with Rubymotion, but I'm not sure how to include the SQLite dylib & header files, if it is possible at all.
As I understand the dylib should be included in the following way:
app.libs += ['/usr/lib/libsqlite3.dylib']
But that's not enough, the sqlite3_open function is still not found. I guess the header file should be specified somehow.
P.S. I know that I can use FMDB to get the same functionality, but I'm wondering about using the C library directly.
I'm not having any issues with mine. Here's my lib entry:
app.libs += ['/usr/lib/libz.dylib', '/usr/lib/libsqlite3.dylib']
Maybe you need the libz.dylib part.
You might check out https://github.com/sxross/MotionModel/tree/sql. I've built an ActiveRecord-like adapter for SQLite using FMDB. The sample app might be a good reference for you.
The fmdb cocoapod github repository currently (as of Feb 26 2014) has 3970 favorites on github, 918 forks, and 336 watchers.
I think this is what you are looking for. fmdb is an Objective C wrapper on top of sqlite.
To get started with cocoapods, run:
gem install cocoapods
the ruby motion gem for handling cocoapods is motion-cocoapods
I'm still looking for an activerecord-like ORM though. there's the motion-sqlite3 gem but so far I haven't been able to get it to work. (5 minutes later) though the motion-model gem is looking promising...& heavily documented
By the way, it's 2020 now and you can easily work with SQLite in a RubyMotion iOS app by using the motion-sqlite3 gem. It hasn't been updated in a while, but that's because it just works.

Resources