Author Topic: inline idea for Android  (Read 2893 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3493
    • View Profile
    • Space Fractal
inline idea for Android
« on: 2012-Mar-30 »
I see on Android there is not possible to call java directly in inline yet? But I do see there is a SDLActivity.java. So I gonna think a idea its could add a INLINE idea to call ONE function, something like this:

USERFUNCTION$(FUNCTION$, ARG$)

In that userfunction its could call a java function directly and then creating a wrapper to call other functions. Yes there is something interpreting here, but those inlines is mostly to possible to hopefully integreate Admon, inapp purchase, more device info and such thing, which dosent require intepreting all time....

the java file could been "user.java" in the same dir where SDLActivity.java is.

All here could been inlines as well.

This is only a idea to been acccepted or not :-D. Its for more advanced topic I know.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10665
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: inline idea for Android
« Reply #1 on: 2012-Mar-31 »
Very good idea. I hope I can find a way to do this. passing an string array byref would be the best.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3493
    • View Profile
    • Space Fractal
Re: inline idea for Android
« Reply #2 on: 2012-May-14 »
Have this been implemented in v11, so we can call java rutines from glbasic (via inline), either via array or by a wrapper (array) string.

I known its not the best soluations, but still its a best method to limit around ndk and glbasic without been too compliced, and you would not often call that much elsewise.

Its could been even just called to a function in SDLActivity.java to start with, even own java file is better.

Personlly I would use this to get more info about device as well example pixel distiny and such thing. That would been possible for us that want it.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Falstaff

  • Mr. Polyvector
  • ***
  • Posts: 148
    • View Profile
Re: inline idea for Android
« Reply #3 on: 2012-May-14 »
If this somehow leads to getting access to the android soft keyboard, that'd be awesome :)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10665
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: inline idea for Android
« Reply #4 on: 2012-May-15 »
keyboard should be supported by INKE$. No?


Can I make an external java file and call a function in it?
Or should I make a dummy function in the sdl-main.java file?

Offline Moebius

  • Dr. Type
  • ****
  • Posts: 315
    • View Profile
Re: inline idea for Android
« Reply #5 on: 2012-May-15 »
I'm in favour of the external file - could we put that in the project directory and have GLB copy that across?  (like w/ icon.png?)
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10665
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: inline idea for Android
« Reply #6 on: 2012-May-15 »
Yes - but can I do this with a function that might not exist - or must I always make such a dummy function?

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3493
    • View Profile
    • Space Fractal
Re: inline idea for Android
« Reply #7 on: 2012-May-15 »
he means to open the software keyboard, here there is no sign of INKEY$, since you need do somewhere to call the keyboard first. Also not all physical buttons is correctly supported. Example the soft touch back button should been returned back to glbasic, and not just quit the app (ICS), unlike the hard back button (Except if circle is pressed on Sony's Playstation Device). Howover its a SDLActivity.java me think? So I look on that later.

The best would of course been direct support of java API calls directly from inline calls, but not sure its possible by using Android NDK and then calling Java API from there?

If that is not possible directly, but possisble indirectly, then the java USERFUNCTION$(FUNCTION$, ARGS$[]) mightbeen the next best thing in sdl-main.java. Its could still been invoked from inline using ?IFDEF ANDROID (Since is a Android thing), so its never touch the other OS builds.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.