converting Java code to Android - java

I Have a Java application and I need to convert it to an Android application
is there any resources to show how ? in Android developer site I didnt found anything like that!
I need to use the Java methods and classes in android ,How it can be done?

If you use the standard android SDK (http://developer.android.com/sdk/index.html) all code is already done in JAVA and should already work in android. Just follow the instructions to set up eclipse and android sdk tools and then import your code to an android project.
The only thing that must be changed is the GUI (graphical user interface) since it's different in android. Do the "hello world" tutorial and "Hello, Views" tutorial in the android sdk page that should put you in the right track of how you should do GUI's in android ;)

Related

Emulate Android in Swing

I want to be able to run my Android code/app on Windows/Mac/Linux/etc. but not use an emulator, as they are slow/cumbersome.
I want a real Java SE app, but to reuse my Android code.
My idea is to make an Android emulator using Swing, read the layout files and create the widgets in Swing and map between the 2 UI event models, life cycle, and library classes.
Question is, does such a thing exist already, I googled it, but could not find anything.
Otherwise I will start an open source project for it myself. Anyone interested in helping is more than welcome.
So I created an open source project "Swingdroid" that lets you run Android apps and Java swing desktop applications.
You don't need to use an emulator or change any code. It loads Android layout files and activities and renders them using Swing.
On GitHub here,
https://github.com/BotLibre/BotLibre/tree/master/swingdroid
I totally agree with #muratgu. But, if you just want to parse Android layouts (views) xml files and render them using Java Swing, this is possible and this has already been implemented, before deciding to make your own implementation, you'd better check the wysiwyg feature of UI editor in Android Studio.

Combining android and gwt?

I'd like to develop a hybrid app using mgwt-phonegap.
I found this link :
What I don't get is: Why is he putting the gwt-code into the android project's folder? Isn't it unecessary to use Android at all when you use mgwt and phonegap? I thought, that was the whole idea behind it?
What do you get from creating an android project and then putting your gwt code inside it?
Can you use gwt to convert a standard android app into a hybrid app for different platforms?
I did not read the tutorial you mention, but with phonegap you can create a native shell, which is basically a WebView with some hooks to call native stuff, In this shell you place your HTML/Javascript which in your case is the compiled code of a mgwt project. The android project you create it with phonegap, their site has a tutorial, I think you should read more about phonegap.

Android gui design tools or framework like bootstrap

I am a web developer, recently i have developed a android app using cordova.
But my application is slow, so i deside to developed the same app using andoid no native code. But the challenge is making same gui. i am new in android.
So my question is that what tools i use for gui design, and is there any framework like bootstrap? thanks in advance.
Maybe this might help: http://www.androidbootstrap.com/
Github link: https://github.com/AndroidBootstrap/android-bootstrap
Android app is also a browser app designed in xml, what kind of app you want to build if its an offline app you have design in xml but if it's online app (ex: playstore) you can use WebView it gives you a browser(with your webpage address hard coded in it) within an app and there you can open your mobile website.
Just like other apps do flipcart, jstdial, amazon etc.
Tools: Android Studio is best but for Start download Eclipse Atd bundle its comparatively light later you can switch to Android Studio.
Unfortunately there is no
and
www.androidbootstrap.com/
You have to do all your design in xml resource, where you can use tags like - style, selector, layer-list, item, shape etc. And these resources have to be controlled dynamically using java (in activity).
In Developers documentation of android (provided by Google) you will find details Style elements

using jquery mobile with java, is it possible?

I need to know how to use the jquery mobile with java coding in the same application, so I can merge some features not available in the jquery platform to make some advanced android application.
appreciate your responses.
First don't listen personne3000, apparently he never touched Phonegap.
It can be done with jQuery Mobile if you use it with Phonegap. Phonegap, while working as a wrapper for HTML5/JS/CSS will give you access to native JAVA code (Android only of course). Phonegap will give you access to the wide range of mobile phone compatibilities ranging from camera, sound record up to creating native tab bar for your app.
Here you will find a "iOS Getting started" tutorial for Phonegap/Cordova and here's an Android tutorial.
Here you can find basic Phonegap/Cordova API reference and this is just a basic list, much more can be found in 3rd party plugin list here.
In case you can't find functionality you need you can create your own plugin and here you will find a Phonegap plugin tutorial for Android platform. In case you are going to use an older version of Phonegap (pre Cordova) here's an older plugin creation tutorial.
I don't think you can directly use jQuery mobile to develop your app. However, you can :
Develop an Android application using Phonegap or Cordova in HTML5/Javascript, and use jQuery mobile, but you won't have access to Java
Use WebViews to display webpages with Javascript included. You might want to look at the addJavascriptInterface method.
Javascript and Java can't be mixed just like that in an application : they work very differently.

Convert android project to java project

I've just finished developing an application for android. I want to have a desktop version that is based on java, too.
I have to convert all layouts to swing and what other conflicts I may face, god knows.
Is there a tool for converting android apps to jar standalone? What is the easiest way to do this?
There is no tool to do this, as Android and Normal Java apps are very different.
The best you could do is move the non platform specific code into a library project, and reference it from both the Java and Android applications. So all code that doesn't use any import with android in it should be movable into the library, while all your swing/android specific code will go into the referencing projects.

Categories

Resources