How can I add offline games to play them bundled in an app?

Get help using Construct 2

Post » Wed Jul 02, 2014 8:54 am

Hello!
I want to add some minigames into an already created android/ios app, so that they can be accesible from a minigame selection screen and played without any internet connection. My idea was to embed them into the generic browser views in both systems and play them locally and offline.

Problem is that I don't seem to be able to do so.

- If I export the game to any of the android or iOS publishing modes, it always ends in a separated apk or ipa file, which is not what I want.

- If I use html5 web export mode, when running the game from the integrated browser, it tells me "Exported games won't work until you upload them. (When running on the file./// protocol, browsers block many features from working for security reasons.). Happens in Android and iOS.

Anyone has any idea of how to do this?

Thanks!
You do not have the required permissions to view the files attached to this post.
B
8
Posts: 12
Reputation: 388

Post » Wed Jul 02, 2014 11:48 am

I think if you export your game to your website, and go to it's url directly, wait a minute or so, then cut your connection and come back to the exact same url in the exact same browser, it just works
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed Jul 02, 2014 11:56 am

Oh, thank you, but that NEEDS internet connection even though it might be only once. But in my case that is not an option. There might be no network available in the devices where the app is running.

What I need is the result of that operation, made locally. There has to be a way!
B
8
Posts: 12
Reputation: 388

Post » Wed Jul 02, 2014 11:59 am

I see, I do not know about a way to do this (browsers are actually preventing local web pages from doing things), maybe combined with somekind of virtual server you could do something about that.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Wed Jul 02, 2014 12:05 pm

Aphrodite wrote:I see, I do not know about a way to do this (browsers are actually preventing local web pages from doing things), maybe combined with somekind of virtual server you could do something about that.



I'll look into the virtual server option, will update if I find something. Surely won't be possible in iOS, but there might be a way. Thanks!
B
8
Posts: 12
Reputation: 388

Post » Wed Jul 02, 2014 12:42 pm

I'm not sure what you're looking to achieve is possible at all in the current HTML5/C2 restrictions.

If you want minigames "embed" inside an app, I'm afraid you'll have to redo/reexport the app so that it does contain the minigames, this way everything is inside a single apk file.

Accessing "local" games is prevented by browsers (the screenshot you displayed) for security and compatibility reasons.
Apart from an iFrame and possibly internet connection, I'm really not sure it is at all possible to access/provide those files/games.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
291
S
114
G
95
Posts: 7,293
Reputation: 70,144

Post » Wed Jul 02, 2014 1:00 pm

I see. That's just what a friend programmer says (I'm a designer) but hey, I'm willing to try and think outside the box ;)

I though that, as the WebView in android has it's own cache and cookies apart from any other app and can be injected with Java objects trough the addJavascriptInterface method, doing this whole thing should be possible. I know there are some security risks, but if the browser gets disconnected I don't see the problem. The thing is that I don't know how to generate this "local runnable content pack" of caché and cookies. And in iOS, well... I suppose the approach has to be a diferent one. I´ll take one thing at a time, if necesary.

But yeah... after all, might be impossible tough XD
B
8
Posts: 12
Reputation: 388


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 27 guests