Delphi XE5 using ftdi jar file in android - android

I'm trying to use the FTDI (d2xx) jar file in Delphi XE5 in a android app.
http://www.ftdichip.com/Drivers/D2XX.htm
But I cant get I to work..
Has anybody got any examples on how to import a (this) external jar file?
OR has done this jar file and got it working (so I know it is possible).
I have tried the methods from
XE5 - Fun with external Java libraries
Well I did't have fun, I can't get I to work (easy peasy?).
I don't know what class to load. I have got a assigned "DEXClassLoader" but don't know what class to load. If I look at the dex file I think it should be 'com/ftdi/j2xx/D2xxManager' but I get a "java.lang.classnotfoundException: com/ftdi/j2xx/D2xxManager" message.
The second option I found was the one from Bian long (coderage 8)
I am still investigating this but my demo licence of XE5 is running out.
(I also found the "Android 2 Delphi Import Tool". But i dont know if it works.
If it works I want to buy it. it's only 80 euro)
If I don't get It working we will not update to XE5 (but I want to..) and wait until there is more documentation / samples.
Can anyone help me..

About your second question
OR has done this jar file and got it working (so I know it is possible))
yes, it is possible. http://www.winsoft.sk/acpftdi.htm
They are selling a source for $60 and have a free demo.
And as an answer to the first question: it's really just an automatic conversion of jar file. I have tried a Java2OP utility from embarcadero and Winsoft's example with minor changes successfully compiled and executed using pas-file generated by Java2OP.exe instead of their library.
So, if someone want to use FTDI with delphi on android, my way of getting it works for free is:
Get Java2OP.exe from http://docwiki.embarcadero.com/RADStudio/XE7/en/Java2OP.exe,_the_Native_Bridge_File_Generator_for_Android (you need a registered delphi to download)
run it:
Java2OP.exe -jar d2xx.jar
After completion, add d2xx.jar and generated pas file to your project, take the example code from http://www.winsoft.sk/acpftdi.htm or from java examples that comes with d2xx.jar.

Related

How to edit the lib2cpp.so file of a unity build inside my Android Project

A third party created a unity project for me but they lost their project on their end. A guy had it on his laptop, never backed it up but he did send the integrated unity project for android. The only issue is that we need to change something inside it. So I have the android project, I just need the built unity's source code.
The same situation occurred with our IOS version, luckily Xcode had the Assembly-Csharp accessible and I could find the value I needed to change. The Android's Unity was built with il2cpp. I've managed to re-secure the assets using some tools I've found online. So I can potentially rebuild the project with new scripts. However this may take a rather large amount of time. So I found I can edit the source code through the hex code, but this seems limited/nigh impossible as I need to make a condition on this string instead of simply setting the value. If there is a way to do this with a hex editor on the lib2cpp.so file I would greatly appreciate even a lead. Alternatively I have found some things on hooking a string, but I am unsure of how to go about this and cannot find sources of where to start such a thing.
Any leads or information on how to edit a string on a condition in the unity source code through it's lib2cpp.so file or libunity.so file would be greatly appreciated!

an issue about extract source code of an apk

Hello I lost my last backup of my project and there is just installed the app on my phone so I need to rescue my codes.
I searched dex2jar,apktools etc but they did not work.
In my apk there is 6 dex class so I can not reach my code
You can extract your code from http://www.javadecompilers.com/apk this link
Note: It can give you all your java classes and resources, but you
have to work on it for some missing constraints. Please do not make
misuse of that....
But its better to have something than nothing.

Issue Debugging Reason XML Won't Parse

I am having some difficulties with my android app parsing an xml that contains links to PDF files. It should open a listView showing all of the files listed in the xml. However, most of the time it just freezes up on me. The app was made by a developer no longer with us, and all I have is the apk and not the source files. Is there a way to use the apk to get the source files and figure out what the issue is? Android is not my forte and I'm at a loss with how to fix this.
UPDATE:
It appears that devices running 2.2 display all the songs just fine, while the newer versions of Android crash when ran.
I've had problems with android 2.2 on my HTC desire taking a long time to parse large XML files. There wasn't much I could do other than switch from DOM to SAX which for some reason was a lot quicker
However debugging this without source code is likely to be pretty difficult. Not least because fixing the issue when and if you find it will require you to re-compile a new class in replacement for the one which keeps freezing.
I would suggest you look into decompiling the APK back into source code.
According to Wikipedia APK files are based on the Jar file format which in turn is a Zip file:
http://en.wikipedia.org/wiki/APK_%28file_format%29
That makes this task a little easier as you won't need to look for a decompiler that is specific to android but a more generic Java Decompiler.
A quick search on google suggests this one:
http://java.decompiler.free.fr/
If you can decompile the app back to source code and then get that source code into eclipse and rebulild from source then you can start to debug.

Android native methods called from Java side

How can I get reach to the native methods called from Java side in Android? My problem is specifically related to AudioRecord class in Android Media package. I read the source code of AudioRecord.java. I found out that most of the jobs is performed by native methods, such as:
native_setup(...), native_start(...), native_stop(...), native_read_in_byte_array(...), native_read_in_direct_buffer(...)
I downloaded Android source code but I could not reach these methods. And I don't actually know the way to reach them. I seek for these methods in libraries I found in source code directories, but I couldn't success. If anybody may have an idea, I would be appreciative to hear. Thanks...
I think I found them. After using the Linux command
grep -r "native_read_in_direct_buffer" ./ANDROID_SOURCE/.*
I found the corresponding cpp files.
AudioRecord.cpp is located in: ~/ANDROID_SOURCE/frameworks/av/media/libmedia/ directory,
android_media_AudioRecord.cpp is located in ~/ANDROID_SOURCE/frameworks/base/core/jni directory.
I wanted to share it as a reference to other possible programmers willing to reach the same/similar source files.

html unit with android

I have a working code with html unit and java(repeat, working code :P) no errors no missing jars.
now I copy paste this same code into an android project, add the html unit library etc... try to run it and I get
could not find class "com.gargoylesoftware.htmlunit.webclient"
and a series of subsequent errors that follow
I tried adding jar files to /libs folder as some suggested(through google) and that cost eclipse to go out of memory before opening the emulator
I also ticking the libraries under order and export (that did not do much)
anyway so the question is, is it possible to get html unit to run with android? and if not, what is the alternative to it in android? my software needs to loginto a server, fill several forms, etc...
thank you
Try creating project from existing source ... I have this problem often when I try foreign code.

Categories

Resources