Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Working Visual Studio 2015 Android Template Lite

Author
Message
m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 9th Jul 2015 16:44 Edited at: 24th Jul 2015 00:08
THIS IS ONLY FOR AGK1

Setting up Ecplise or Android Studio to debug native libraries on a real device
is a pain. Yesterday i've discovered that, visual studio 2015 community edition
is able to debug native android libraries without having to configure anything. Amazing!
I started to think if it would be possible to create an AppGameKit Template project,
to see if i am able to debug the code without much trouble, at the end VS uses
the android sdk and ndk to build the apk file. After some tests, I've finally managed
to port the AGK1 template_android_lite project to VS 2015. There are some restrictions
for the AppGameKit functions that call third part functions, such as admob, facebook etc.
but for debugging/testing the C++ core functions of our games it is perfect.

I've created a project template for VS 2015 that can simply be opened with VS.
The only thing I've removed from the template is the libAGKAndroid.a file, so
you have to put that file manually in the AGKTemplate.NativeActivity folder.

One other thing you have to configure on you system, is the additional include path
for the AppGameKit Header files. Right click on the AGKTemplate.NativeActivity project
and then configure the include path.

After that you should be able to build and run the template on a real android device.

I would like to post the template here on the forum, so that other devs can use
it to, but I don't know if it is ok for the game creators. As already mentioned
I've removed the libAGKAndroid.a file from the template.

Here is the download link for the template:


http://doubletap.bytechaos.de/AGKTemplate_VS20015CE.zip

The only things you have to do is:
- Copy the libAGKAndroid.a into the AGKTemplate.NativeActivity folder
- Fix the include path in Visual Studio so it can find the AppGameKit Header files.
- Set the JAVA_HOME environment variable to point to the JDK path.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 9th Jul 2015 19:39
Sounds interesting, thanks for experimenting with it. Yes, you can post the template, as long as you remove the lib as you say.
m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 10th Jul 2015 15:30
Hey guys,

as mentioned in the first post here is the download link for the template:


http://doubletap.bytechaos.de/AGKTemplate_VS20015CE.zip

The only things you have to do is:
- Copy the libAGKAndroid.a into the AGKTemplate.NativeActivity folder
- Fix the include path in Visual Studio so it can find the AppGameKit Header files.

I hope it will help you.
m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 10th Jul 2015 21:59
I found another thing you must do:

You have to set the JAVA_HOME environment variable to point to the JDK path.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 15th Jul 2015 21:22
I want to port a win 2d game i made with AppGameKit Tier 2 in vs 2013 to android so i downloaded your template for vs 2015, but i have one question, i connected my phone with usb running Lollipop 5.1 but in the editor says there are no device available. how should i compile and run the apk if it gives me 20 errors in empty project?

ps i fixed the include path for AppGameKit Headers.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 16th Jul 2015 02:47
Update: i managed to compile the project but when i try to open it in my phone says that it stopped working, tried in Android 4.4 too, i think im just gonna translate my program in lua so that i can use Corona SDK... works better for mobile. but anyway maybe i did something wrong, any ideas?
m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 16th Jul 2015 10:10 Edited at: 16th Jul 2015 10:12
Hi PrometeoPrime,

i've only tested it on visual studio 2015 community edition, so i don't know if it works on vs2013.

I think that you have set up adb correctly and that you have installed the needed usb drivers, if needed.

You can only choose your device if you build the solution for ARM.


You also have to tell the IDE that you are building for android, by passing the IDE_ANDROID directive directly to the compiler or by defining it in one of your header files. Simply put the following lines in one of the header files of the template:



It is also important to put the right libAGKAndroid.a in the project directory, depending for what cpu you want to compile. If you build for ARM you have to take the ARM library, if you build for X86 you have to take the X86 library.

If you do so, and you have followed the instructions in the first post, you should be able to compile and run the template on your device.

I hope it helps.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 16th Jul 2015 23:59
It still isn't detecting the device.. anyway im using vs 2015.
anyway, where's the ARM lib?
m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 17th Jul 2015 11:11
- Strange that it does not recognize your phone... Do you see your phone if you type "adb devices" in your command prompt?

- The libAGKAndroid.a is inside the template_android project that comes with the agk installation. You have to look into a subfolder of the jni folder.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 17th Jul 2015 13:10
i didn't have the adb driver installed lol, anyway in cmd it sees the device , but it says that it is unauthorized too (i don't really know what it means) and i activated the debug usb on my phone
still not see my device in vs 2015.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 17th Jul 2015 13:25
now vs 2015 can see my device.. i message on the phone pop out asking if i authorize the pc to debug on the phone, anyway, when i try to debug it give me 20 errors in the Include\network.h directory, and this is a bigger problem right?
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 17th Jul 2015 13:35
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 23rd Jul 2015 22:09
I've got exactly the same errors as PrometeoPrime. Can anyone help with this?

m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 24th Jul 2015 00:05
Sorry dudes, but this template is for agk v1, it seems that you use agk v2.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 24th Jul 2015 01:02
DUDE com'on xD i don't want to install eclipse and 1000 other things to develop on android, i already tried and didn't work... do you know any tutorial how to set up eclipse for agk 2?
or maybe just a template like this but for agk 2. could you convert it?
xGEKKOx
AGK Master
15
Years of Service
User Offline
Joined: 7th Dec 2008
Location: Italy
Posted: 24th Jul 2015 11:02
Is Visual Studio 2015 Community free?
I can't find info on it.

m0rph3us
10
Years of Service
User Offline
Joined: 24th Jul 2013
Location:
Posted: 24th Jul 2015 11:32
Yes its free, you can download it here.

https://go.microsoft.com/fwlink/?LinkId=532606&clcid=0x409
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Jul 2015 13:12
Oh God... It seems like we need to wait for Paul to make this feature for those who use tier2... But Paul is busy right now. It's so sad...
By the way, PrometeoPrime. You should know that using Eclipse with NDK it's not just a pain! With NDK - I just got many compiler errors and I don't even know what that were an errors.
PrometeoPrime
8
Years of Service
User Offline
Joined: 13th Jul 2015
Location:
Posted: 26th Jul 2015 18:15
Well i will wait, this engine is great, and if i could just use one ide to develop in 2 platforms would be greater too

Login to post a reply

Server time is: 2024-04-26 22:42:37
Your offset time is: 2024-04-26 22:42:37