Author Topic: Android Extras (Micro Game Consoles/GPS/Keyboard/Audio)  (Read 66327 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
im are being upload 2.3.1 now to dropbox (only full with full sdk this time). this fixes icon issues, eventuelly create missing androidextras icons (if icon.png exists), BATTERY permission should also could safe to been removed if not used, and also KITKAT fullscreen support.

This is not a big release, but more a minor.

PS. Im really hope a day im could integrate most of the Android Extras to the stuck glbasic for v13 (which mean game controllers, fixing orientation, fullscreen and eventuelly the alternative sound thing). Rest will remain external (such like ads and Storekit).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline veketor

  • Mc. Print
  • *
  • Posts: 21
    • View Profile
Thanks for this great piece of code spacefractal.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4159
  • On the shoulders of giants.
    • View Profile
    • My Apps
Your dedication to this is great Alan. Keep up the excellent work  :good:   :nw:
I came. I saw. I played.

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
look like something is wrong in InAppConfig_SkuNames$() and/or SKU is not correctly config in Google Play console, so names cant been found.

Its seen its have not found any sku at all from the Google Play, so its have no items found, then you will allways get a 0.

When sku is correctly setup (which is the hard part to setup), then IAPHELPER in the logcat will spitout price and details of it, just after Querying SKU details.

dont uses sku name like com.spicypixel.fishyfingers, which is your package name, but instead uses something like com.spicypixel.fishyfingers.premium and make sure its active in Google Play (even you have not released your app).

Also you cant purchase from your own account, but you should still see price and details of a sku in the app.

I've done the changes with SKU name and these are reflected in the InApp name too (com.spicypixel.fishyfingers.premium) but I still get a 0 too for InAppPurchase_isOnline() ???? If I had an example I'm sure I could sort it but there isn't one.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
InAppPurchase_isOnline() is only works on iOS, not on Android. This functions actuelly does not need on Android by now. This is a limit im should look on too. All the function will does, is if the device on the internet (online) or not (offline), and does not checking any purchases at all. But its currently only works on iOS.

instead checkout InAppPurchase_Price$() as well InAppPurchase_isAvailable$(). Please Note its might take a little while, so best do that in a SHOWSCREEN loop.

Also you can PM me your sample project, and then im will look on that, if you eventuelly have found a bug somewhere (which happens when im helped Ian)....
« Last Edit: 2014-Aug-11 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
I'm out now until later this evening but I'll zip the project for you to look at. Cheers SF.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
howover you can do still check if its online by checking the price instead, which might return "unknown". Howover im looking on the project, when im got it and see if you have found a bug etc.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
Im have updated AE to 2.4b1, here is the news:

Android StoreKit is updated to uses openiab-0.9.7.2.jar rather than the source Java files in the old version. Due this, make sure to delete libs and scr foldes to avoid dublicate of classes and hence fails to compile. Im have now moved it to Android Extras and is being integreated instead being separate. iOS version for StoreKit is STILL supported in inapp_functions.gbas. Im will later update the seperate version of the project for xCode. The files here is not changed since Beta 5 (even with the updated files).

inapp_functions.gbas is also got updated its helper files, due the OpenIAB used now supports bounch of new shops.

Sound/music (if SoundPoll is used) is now supported when pause the app or pressing the hold button.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
im might forget to tell the newest version might require targetSdk 19 now (to support the new icon sizes for the extreme retina displays).

etc in your manifest.xml, do this:

    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="19" />
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
From 2.5, im will begin to uses the glbasic Source Code for fixing various issues, but im do keep compatible with v2.4 throught.

- Java can now been called as a Extern function in sdl_main.cpp
- The Asset File Installation is now removed. Its was quite unstable on new installations or when its fails (etc user interupts the installation, then the app wont working anymore).
- SETORIENTATION(-1) does now perform the default orientation on Android (which also do that automatic on setup).
- DOESFILEEXIST copy/replace the relevant asset from APK if not exists (replacement for Android.Check_Asset() from AndroidExtras.gbas), before checking the file exists.
- DOESDIREXIST now copy/replace the whole folder from APK if not exists.
- KEY() function now uses Java based scancodes directly, without converted by SDL Input (from 0-512). Some devices can have scancoded >256 used.
- ALLOWESCAPE can now finally disable/enable back button.
- OUYA, Mojo and GameStick is now returned as "CONSOLE" for PLATFORMINFO$("device").
- Fixes to the Intersititial.gbas, so more than one ads can been shown (which also require update to two files in the Java part as well).

License in the source code have not been touched at all and im newer will do tha.

EDIT:
 im are just going to reupload it now (im was forget to include few files and should not have removed SDL_MIXER. That would only been those that have access to Source Code).
« Last Edit: 2014-Dec-01 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
2.5.1 is now online.

Im was forget to include the two a files required to fixing the commands. OOPS.

Also 2.5.1 is also fixed the AUTOPLAY TRUE issue. This was just a pure Java issue.
« Last Edit: 2014-Dec-01 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline S.O.P.M.

  • Prof. Inline
  • *****
  • Posts: 529
    • View Profile
What exactly does this mean if I want to use the new AE for my existing project? How do I now load sprites and other resources - by using the internal DOESFILEEXIST command before calling LOADSPRITE? Or can I, after installing the new AE, load my media like the default way? If not, does this mean DOESFILEEXIST cannot be used in the way as it was designated? I ask because I need the command for the usual operation to check files that are data files for my game, not media resources! Please clarify that.
Notebook PC Samsung E372 Core i5 @ 2,6 GHz; 4 GB RAM; Win 7 Home Premium

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
From the help file:

Code: (glbasic) [Select]
The glbasic using a pretty long wait screen, with a animated ..... screen. How-over that screen take very long time, and its can fails sometimes too, so this screen have been removed at all.

This require you need to checks if the file exists before loading it on Android on all files and you should not do a SETCURRENTDIR("Media") to load your files, but using subfolderes directly. This due Android does NOT support SETCURRENTDIR() currectly when Java is called, which is still on the Root folder. This issue is still not fixed.

IF DOESFILEEXIST("Media/yourmedia.png") THEN LOADSPRITE 1, "Media/yourmedia.png"

Sometimes you need to create the full diretory, because you want to scan them first. Here you can checks if a DIR exists, like this:

LOCAL files$[]

DOESDIREXIST("Media/levels")

LOCAL cur$ = GETCURRENTDIR$()
LOCAL num = GETFILELIST("*.*", files$[])
SETCURRENTDIR(cur$+"levels")
num = GETFILELIST("*.txt", files$[])
FOR i=0 TO BOUNDS(files$[], 0)-1
......
  NEXT
  SETCURRENTDIR(cur$)

You might want to save memory for the Android Internal harddrive by doing this command:

Android.Check_AndroidMem(File$)

you just need to uses DOESFILEEXIST before any file access (or DOESDIREXIST if you want to scan a dir before reading). That command will copy the assest file from apk to the memory (and eventuely update it) and then recheck if the file still exists. If that file cant been found in the apk nor in the folder, its will returns FALSE. If its is from APPDATA folder, its would been checked directly as normal.
« Last Edit: 2014-Dec-01 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
in the next version im look on those commands:

PLATFORMINFO$("APPDATA")
PLATFORMINFO$("DOCUMENTS")

Unlike the help document write, you cannot write to PLATFORMINFO$("DOCUMENTS") on some Android systems. That folder point to the DOWNLOAD folder. But that folder is now write protected, so that cant been used at all for save games and should newer use that. on iOS its the other way. Here im could not write to the APPDATA. but works in DOCUMENTS. Quite confuction. That why im allways uses a variable to point to the path when using save games.

Im gonna thinks im should swap them, or give a option to swap that? This is also something that should been updated on the HELP file. Its incomplete here.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4159
  • On the shoulders of giants.
    • View Profile
    • My Apps
Having just one option would be less confusing (say, APPDATA) - let GLB save stuff to the only possible save location based on the device.
I came. I saw. I played.