Mark M. | has entered the room |
Mark M. | turned on guest access |
Matt | has entered the room |
Mark M. |
hello, Matt!
|
Mark M. |
how can I help you today?
|
Matt | |
Matt |
I'm trying to integrate a .so library into my app.
|
Matt |
View paste
|
Matt |
View paste
|
Mark M. |
um
|
Mark M. |
let's back up a step
|
Mark M. |
what exactly are you planning on doing with this .so?
|
Nov 12 | 9:00 AM |
Mark M. |
are you writing your own NDK code that will attempt to use it?
|
Matt |
it's to include a library that captures the device's screen and allows key injections
|
Mark M. |
which means it requires root
|
Mark M. |
and that doesn't really answer my question: are you going to be writing your own NDK code that will attempt to use this .so?
|
Mark M. |
or does the .so have JNI-style functions exposed?
|
Matt | |
Matt |
im not sure
|
Mark M. |
then you will need to ask Samsung
|
Matt |
View paste
|
Mark M. |
for example, an arm64 binary does not go in an armeabi folder
|
Mark M. |
if Samsung will not provide instructions for using the .so, then nobody else really is going to be able to help you
|
Mark M. |
certainly I can't
|
Matt |
i'll try dig out the post the gave me.... 1 minute
|
Matt | |
Mark M. |
OK, so you need to write your own NDK code that uses this library
|
Nov 12 | 9:05 AM |
Matt |
so far i have put the .so in the jnilibs folder in the project
|
Matt |
sorry mark , i've been called outside to move my car...typical... back in 2 mins
|
Mark M. |
I have never tried using a precompiled .so, so I don't know the exact process there, other than a 64-bit binary (arm64) does not go in a 32-bit folder (armeabi)
|
Mark M. |
OK
|
Nov 12 | 9:10 AM |
Matt |
Hi Back, There are 2 .so files, one in the arm64 and one outside of that folder. i presumed that the one outside the arm64 folder was the armeabi one.
|
Matt |
is the best thing to ask Samsung then?
|
Mark M. |
yes
|
Matt |
i just wanted some help first in the set up of things
|
Mark M. |
their instructions in that thread were, um, limited :-)
|
Mark M. |
you might want to poke around a bit and get basic NDK builds set up in your project, ignoring their library for a bit
|
Matt |
:) yep i know, butthey did say if i needed further assistance
|
Mark M. |
write a C function that returns "Hello, world" or something and confirm you can talk to it from your app
|
Matt |
do you know any good tutorial to hand?
|
Mark M. |
well, I have a chapter on the NDK in my book
|
Mark M. |
it's not great, as I don't do a lot of NDK work
|
Matt |
ok i'll check that as well
|
Mark M. |
(as in, nearly no NDK work)
|
Mark M. |
my best "example" of using the NDK is my CWAC-AndDown project: https://github.com/commonsguy/cwac-anddown
|
Mark M. |
for adding the hoedown Markdown processor to Android
|
Mark M. |
frankly, Samsung should do what I do and package up an AAR that has the .so files and such in it
|
Mark M. |
so they just tell people to add such-and-so repository and such-and-so compile statement to the dependencies list in the build.gradle file
|
Mark M. |
and, boom, you have the library
|
chike | has entered the room |
Nov 12 | 9:15 AM |
Mark M. |
Matt: let me take a question from chike, and I'll be back with you shortly
|
Matt |
mmm the sounds better
|
Matt |
ok
|
chike |
Hi Mark
|
Mark M. |
chike: hi! welcome to the chat! how can I help you today?
|
chike |
Please i need help understanding SyncAdapters
|
Mark M. |
since I have never used one, I probably cannot help you
|
Mark M. |
but, you are welcome to ask
|
chike |
ok so what do you use instead
|
Mark M. |
um, anything else
|
chike |
like what
|
Mark M. |
if you mean "how do I exchange data with a server", I'll use an IntentService, with any number of possible triggers (push, AlarmManager, JobScheduler, manual invocation, etc.)
|
chike |
ok. Mark now i get your point
|
chike |
i am good.. thank u
|
Mark M. |
OK
|
chike | has left the room |
Mark M. |
Matt: back over to you!
|
Nov 12 | 9:20 AM |
Matt |
When you say write ndk code what do you mean exactly?
|
Mark M. |
write C/C++ code
|
Mark M. |
that uses the NDK to be included as part of an Android app
|
Mark M. |
usually, that involves writing some JNI functions that serve as the C side of the bridge between your Java code in the app and the bulk of your C/C++ code
|
Mark M. |
so, in their post, "Next, ensure to call RemoteDesktop APIs in the following sequence in the .cpp file"
|
Mark M. |
"the .cpp file" is your C++ code to invoke their library
|
Mark M. |
presumably doing so under direction from your Java-based Android app
|
Matt |
so if i have the .so file in the correct folder how do i link the jni code from my app to their libray. there must be a way of mapping the functions?
|
Mark M. |
well, in ordinary C/C++ development, you would tell the linker to include the .so files as part of your compilation
|
Mark M. |
I presume that there is some equivalent as part of an NDK build
|
Mark M. |
but, as I mentioned, I have never used a precompiled .so file
|
Matt |
i think later in the post i gave you there is an option to compile the .so again in the project
|
Nov 12 | 9:25 AM |
Matt |
i think i need to get up to speed then maybe go back to Samsung.
|
Mark M. |
I do not see what you are referring to, sorry
|
Matt |
i just don't want to waste their time with my lack of knowledge, i need to break a few things down first
|
Mark M. |
agreed -- start with some NDK basics, then once you're more comfortable with that, you should be in position to ask some more focused questions of Samsung
|
Matt |
ok cheers, thanks and bye for now.
|
Matt | has left the room |
Nov 12 | 9:55 AM |
Mark M. | turned off guest access |