beneroth changed the topic of #picolisp to: PicoLisp language | The scalpel of software development | Channel Log: https://libera.irclog.whitequark.org/picolisp | Check www.picolisp.com for more information
z4k4ri475 has joined #picolisp
z4k4ri475 has quit [Client Quit]
anon has joined #picolisp
anon is now known as z4k4ri4
z4k4ri4 is now known as z4k4ri4_
z4k4ri4_ has quit [Quit: z4k4ri4_]
z4k4ri4 has joined #picolisp
z4k4ri4 has left #picolisp [#picolisp]
z4k4ri4 has joined #picolisp
z4k4ri4 has left #picolisp [#picolisp]
z4k4ri4 has joined #picolisp
z4k4ri4 has left #picolisp [#picolisp]
z4k4ri4 has joined #picolisp
z4k4ri4 has quit [Client Quit]
z4k4ri4 has joined #picolisp
<z4k4ri4> Can I ask about android PilBox here?
seninha has quit [Quit: Leaving]
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
<abu[m]> Hi z4k4ri4! Yes, sure, PilBox is also covered here.
chexum has quit [Remote host closed the connection]
chexum has joined #picolisp
seninha has joined #picolisp
<z4k4ri4> OK here's my background I grokk lisp but have no practical experience in it and while I used to code java j2me I've no experience in android programming
<abu[m]> ok
<z4k4ri4> So I want to make simple android app proof of concept to:
<z4k4ri4> 1) read qr code (I can see pilbox has example for it)
<z4k4ri4> 2) read rfid via nfc API
<z4k4ri4> 3) send it to another server ideally using client side SSL cert
<z4k4ri4> On rfid I only need the basic manufactured tag identifier so no need for custom read or write operation
<abu[m]> OK, so (1) and (3) are easy I think. (2) I haven't tried
<abu[m]> I thint you need something based on (setq *NfcAdapter (java "android.nfc.NfcAdapter" 'getDefaultAdapter CONTEXT))
<abu[m]> What does work here is (msg (java *NfcAdapter 'isEnabled) " enabled")
<z4k4ri4> I'm still reading and understanding both picolisp and nfc example java code
<abu[m]> I have no idea about the tag identifier
<z4k4ri4> So here's first question does the pilbox can read nfc? Do I need to custom compile the pilbox myself?
<abu[m]> Is there an API call?
<abu[m]> If there is an API in Android, you don't need to rebuild PilBox
<z4k4ri4> Here's example code I want to "port" to pilbox
<abu[m]> It will not be possible out of the box to have PilBox respond to intents
<abu[m]> i.e. we cannot extend AndroidManifest dynamically
<abu[m]> Only Java calls
<abu[m]> Some time ago I seem to have tried this: http://pb1n.de/?296e08
<abu[m]> If I do, I get
<abu[m]> [LISP:1] java.lang.ClassNotFoundException: android.nfc.NfcAdapter.ReaderCallback / java.lang.ClassNotFoundException: android.nfc.NfcAdapter.ReaderCallback
<abu[m]> Not sure, I did not investigate any deeper
<z4k4ri4> So I need to "rebuild" pilbox to add nfc stuff to pilbox manifest then?
<z4k4ri4> So my code can respond to nfc intent
<abu[m]> Depends what you need. If you want an IntentFilter, then yes.
<z4k4ri4> Do I need to? (still trying to grasp android API structure in a weekend :)
<abu[m]> I think you need the <intent-filter> if you want PilBox to be started externally and receive data
<abu[m]> If PilBox runs and wants to read NFC, it should be doable the normal way
<abu[m]> What I don't understand in my example above is why the class is not found
<z4k4ri4> So just normal should work?
<abu[m]> Is it because the API is not available on my phone? As I said, I did not investigate further back then (seems it was in 2019)
<z4k4ri4> No need for custom compile
<abu[m]> "android.nfc.NfcAdapter" is there, but not "android.nfc.NfcAdapter.ReaderCallback"
<abu[m]> Maybe I did something wrong
rob_w has joined #picolisp
<z4k4ri4> <abu[m]> I thint you need something based on (setq *NfcAdapter (java "android.nfc.NfcAdapter" 'getDefaultAdapter CONTEXT)) <~ thanks abu I think this just enough to get me started the right way
seninha has quit [Quit: Leaving]
<abu[m]> I just tried again, and found one point
seninha has joined #picolisp
<abu[m]> (java T "android.nfc.NfcAdapter.ReaderCallback")
<abu[m]> should perhaps be
<abu[m]> (java T "android.nfc.NfcAdapter$ReaderCallback")
<abu[m]> i.e. the "$" for a local class
<abu[m]> This is always not clear from the Java references
<abu[m]> Then I get the next error: java.lang.NoSuchMethodException: enableReaderMode([Ljava.lang.Class;@7160a57)
<abu[m]> The method enableReaderMode exists, so the args must be wrong
<abu[m]> Perhaps the last arg, the Bundle. Is it OK to be null?
<abu[m]> Ah! Found the problem!! ☺
<abu[m]> The 'null' must be passed as a symbol and thus needs to be quoted
aw- has quit [Quit: Leaving.]
aw- has joined #picolisp
<abu[m]> Next version of PilBox will have 'null' auto-quoted
<avocadoist> would having standard support on build (no cygwin/etc) for Windows be too much work ? just curiously wondering
<abu[m]> The main problem is not the build, but the runtime environment. PicoLisp needs POSIX.
<abu[m]> All non-trivial parts like multiplexed I/O, terminal and process handling, child processes, interprocess communication, file control, sgnals etc. use POSIX-mechanisms
<abu[m]> PicoLisp is not just a language, it is a full ecosystem
_whitelogger has joined #picolisp
z4k4ri4 has quit [Ping timeout: 272 seconds]
z4k4ri4 has joined #picolisp
seninha has quit [Quit: Leaving]
seninha has joined #picolisp
seninha has quit [Quit: Leaving]
seninha has joined #picolisp