How to setup libGDX project only for Android & iOS? - android

i have developed some applications on android.But now i want to learn game development in Android & iOS with libGDX.
I want to only develop for Android & iPhone.I do not want a desktop project.
All tutorials tell me to first create desktop project than write code in main project & than run as Android application.
But i want to write code in android project using both android & libGDX features.
is this possible ?
if yes than how ?

In order for you to multi-target with LibGDX, you need to use the core project for shared code, and the starter project for each platform you are targeting (the desktop target is not required if you don't intend to do desktop). If you want to use platform specific code, typically that would be done through an interface (see https://code.google.com/p/libgdx/wiki/ApplicationPlatformSpecific).
If you want to only target a single platform and not use a shared project, you can can create a single project for that platform then add the appropriate jars and other resources. I think this makes more sense for Desktop only or Android only as the iOS stuff is less straightforward to set up.

Related

Opentok module for Titanium SDK that supports both Android and IOS?

I am developing a mobile application using Titanium SDK. This is my first mobile app. Most of the app is done successfully. The only module that remains is Video conference support. The company I am working in has chosen to use Opentok SDK. I finished the web application and it works fine. Now I've hit a wall in mobile app and can't move further. The problem is Opentok provides a module to use for Titanium, But it only supports build to IOS not Android. The reason we chose Titanium is for cross platform support.
Is there any module available to use or any other way to implement Opentok with Titanium that builds into both Android and IOS.
I have already tried using a WebView to open the conference module of web application. But bad luck, Opentok only works with chrome browser in mobile. But WebView utilizes native stock browser which does not support WEBRTC. So, opentok doesn't work with webview too.
Please help me. This is my first app and I am stuck at this point.
To Create a Module for OpenTok Android:
These are the steps I would follow.
Create a new Android module: titanium.py create --type=module --id=com.tokbox.ti.opentok --platform=android --name=opentok-titanium
Follow the installation instructions from OpenTok for Android. (Hint: I added a separate section down below to help you get through their instructions.)
Make sure the module runs: ant run.emulator or ant install.
Try running their sample, fully in JAVA, completely separate from Titanium. Make sure it works, and you know what it should look like. Then, figure out what exactly you need from their API. Or, if you're feeling ambitious, decide you want everything. Work to strip down the example to just the surface area that you need. Simplify it down to the least number of files you feel makes sense.
Write an example/app.js that demonstrates how you want the module to be used. For example, maybe you'd start off by requiring the module, then setting some API + Session keys, then calling some API, etc.
Based on the documentation, port what you need in to your module. Reference the Appcelerator Android module dev guide and open source Android modules for inspiration.
Write documentation for the module to specify what the various properties, methods, etc are, so that other developers can figure out how to use the module.
When you're done, submit a PR to OpenTok and revel in your creation and contribution.
Some Hints for Step 2:
.jar files go in lib/.
.so files go in platform/android/libs/armeabi/
Permissions go in timodule.xml, and you can see an example in the open source PayPal module for Android
OpenTok does not work with WebView. OpenTok support for Titanium Android does not currently exist because it is currently in beta and we don't currently have engineering bandwidth to build a Titanium Android integration. However, if you are familiar with Titanium, you are more than welcome to add the integration yourself and send a pull request. You can get the Android beta here and you can get titanium source code here
If you are in a hurry and open to trying other frameworks, our PhoneGap Plugin currently supports both android and ios.

Convert android app to IOS using phonegap?

I developed an android application with Phonegap and I want to convert it to iOS as well. Before starting my project I heard that we are able to convert same project with multiple platforms using phone gap. But now I don't know how to convert my project to IOS. Can any one suggest good tutorial OR examples to do it.
And also mention what are all prerequisites to convert my android application to IOS using phone gap.
Suggest me some tutorials with examples.
With phongap you can target all platforms including iOS, android and windows etc. using HTML 5, avoiding each mobile platforms' native development language. Code base remains same for every platform. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device's sensors, data, and network status. refer docs http://docs.phonegap.com/en/3.2.0/guide_overview_index.md.html#Overview
Phonegap is not for converting one build to another.. Using phonegap you can develope for all platforms using phonegap framework, you can generate .apk,.ipa,ota, etc as you wish using sdk in your pc or using phonegap build service. You can read here(phonegap authentic doc) how can you do it for different plaforms.
Nb:Phonegap provides complete documents in their site itself, you can go through and understand, it is helpfull.
You can build on each platform. If you don't want to do that, they offer a Build service that build your app on each platform for you. See https://build.phonegap.com/ for more info.
With phonegap you can create all platform application with same package just you need to clear yourself that for IOS you need certificates to build it. Otherwise same package you are using for android can use for IOS also.

How the html5 works as a cross platform?

I am currently looking for a cross platform technolgy for my Android App, I come to conclusion of HTML5,I tried some sample code and some Native applications using PhoneGap.
I'm little confused about Native Application(Using PhoneGap),It Uses .java files for writting plugins for Android, now if I want to develope same App for Windows,should i need to create new plugins for windows phone?.
(I'm working on NFC project in android.The plugins for NFC in android are available at
http://phonegap.com/2011/09/26/building-an-nfc-enabled-android-application-with-phonegap/
)
Yes. You will need to create plugins for different platforms that you use. You can use the base set of API's everywhere but if something does not exist, then you'll have to create a plugin for it in the platform's native language. You can contribute these plugins as open source back tot he community so others can use it as well.
See the plugin development guide here:
http://docs.phonegap.com/en/2.1.0/guide_plugin-development_index.md.html

can I develop android applications using gwt?

(or is there a way to convert gwt apps to android apps?)
It is not entirely correct to say that GWT is meant to create code that runs in a browser. GWT translates Java to Javascript and includes ui support and other goodies for web apps. There are a few native application wrappers that take Javascript applications and make them native for Android (or other mobile operating systems) with additional support for device access through Javascript apis. With a glue layer in between GWT and a native wrapper for a Javascript app you have a complete solution from GWT programming to native app.
So, you cannot do this with GWT alone but if you combine GWT with some other libraries it is absolutely possible.
Checkout PhoneGap/Cordova and either m-gwt or GWTMobile. NextInterfaces is built on top of PhoneGap and GWT-Mobile. I'm sure that there are more, but those seem to be the common solutions.
If you want to develop native Android Apps (i.e. written in Java) then you cannot use GWT. GWT is a framework for developing applications that run in a browser: you write your application in Java and GWT will compile it to JavaScript, which will then run in the browser.
If you want to develop web-applications that work in Android's browser, than you can most definitely use GWT. Native support for touch events was recently added to GWT and there are others who are developing widgets, e.g. http://code.google.com/p/gwt-touch/
GWT apps are executed through a browser, but if you want to develop native Android Apps with the same code, take a look at PlayN. It's quite limited but the resulting app will work on a browser, Android, iOS and desktop
GWT is cross-platform and works on WebKit based browsers, like those in iPhone and Android. GWT Mobile WebKit, might be of great help to you.
However there seem to be some issues with Scrolling using GWT in Android while it is seem to be fine in iPhone
Here these are the steps to create android app from gwt app
Compile the GWT project. Right click on the project, select Google-> GWT compile and select the project. It will take some time till it gets compiled. The new stuff is created in war directory in that GWT project
Than create new Android Project let’s say GwtTest.
Create libs folder if not generate automatic and paste the phonegap.jar (0.9.4 or above), I used phonegap-1.2.0.jar
Add the jar file on project’s Build path
Copy all generated stuff from GWTProject/war directory to GwtTest/assets directory (gtwproject, WEB-INF, css and html file)
Now in android project’s MainActivity, extends DroidGap instead of Activity. Remove setContentView line and add this line: super.loadUrl(“file:///android_asset/index.html”);
In Manifest.xml file add line of internet permission:
uses-permission android:name=”android.permission.INTERNET”
Create xml folder in res directory, put cordova.xml and config.xml file into the xml folder. Now you can run GwtTest as Android Application.
Remember the apk that will be generated while run as android, the size of apk is around 35mb. So make sure that your android device has this enough size.
Since GWT is Java a lot of your code can be reused on Android. However, some code such as the UI can't. Google inbox reuses 70% of it's gwt code on android.
Look at this question too
if you want to develop the app that would run in the browser and android (and few other platforms on the way) you could use playN

I've downloaded and built the Android source... now what?

I've built an Android app in the past (on a Windows machine using Eclipse), but having downloaded Ubuntu, the Android source and built it successfully (whew), I'm not sure how to tie it all together. How do I load my app into the Android that I've built?
If you really want to be building your own ROM you should head over to the Android Platform Developer's Guide and read it all through.
However if you simply want to develop your own applications then you only need the SDK (and on rare occasions when you want to add some native code also the NDK).
The easiest way to develop Android applications is by utilizing the Eclipse integration, which does most of the work for you.
You also probably want to know what all of the SDK tools (even if you are building your custom ROM) that the Eclipse plugin is using behind the scenes do, so head over to the Tools Overview.
You may want to take a look at the Android Cookbook.
It has loads of nice wee snippets of code to get you started.

Categories

Resources