Android Studio Design Tab Grayed Out - java

I imported a libgdx project into Android Studio to create the UI for my app. I tried to open the designer to easily add items to the UI, however the design tab from View > Tool Windows > Designer is grayed out. I assume it's because it's an imported project, would be great if anyone knew of a way to open the designer, thanks!

Scene2D comes with LibGdx which is usually used to create everything related to UI. I wouldn't recommend to use default Android UI with LibGdx game.
Here is some documentation an tutorials how to use Scene2D in your LibGdx project:
https://github.com/libgdx/libgdx/wiki/Scene2d
It's also recommended to use Ninepatch for your UI elements such as buttons so it can scale the buttons and other elements correctly. There is also a documentation and tutorial for that here:
https://github.com/libgdx/libgdx/wiki/Ninepatches

Related

Stuck on making Android apps with NetBeans, missing functions I normally love

I've followed the tutorial link below, so to create an android project within Netbeans but I can't find the design view even when I click on the XML files. Am I missing something?
https://blogs.oracle.com/geertjan/entry/dummy_guide_to_netbeans_android
Any tutorials explaining this would be great :-)
The reason I would rather use Netbeans over Eclipse, is that netbeans allows the use of a pallet to drag "buttons" or "listbox-es" over to the design view. And on click open up the buttons functions i.e. "on click" or "on item state change"
Netbeans does not have an android layout preview function like in Eclipse. You will have to install a plug-in located here:
http://www.nbandroid.org
Any version published after October 2012 will enable you to have the feature you are looking for.

JavaFX 2 - JPedal included in a Pane

Is it possible to include a JPedal PDF Viewer in a HBox JavaFX Application, with other stuffs added to the following slots of the HBox? Any tips?
I am unsure if it's possible to put JPedal inside JavaFX - there's no official mechanism for putting Swing inside JavaFX, but you may be able to find some hacks online. Perhaps this functionality will arrive in JavaFX8 or 9.
Regardless, it's a possibility that in the future JPedal will include a JavaFXDisplay if there's a demand for it and it's commercially viable.
We do lots of playing with JavaFX - we currently have an online converter to demo PDF to JavaFX and PDF to FXML functionality: http://www.idrsolutions.com/online-pdf-to-javafx-fxml-converter/
Recently we announced that we have swapped out Java3D for JavaFX in the PageFlow mode inside JPedal's Viewer: http://blog.idrsolutions.com/2013/01/announcing-the-pageflow-pdf-viewer-mode-in-javafx/
There's a video of it in action here: http://www.youtube.com/watch?v=auwNrIPt0Tc
And as already pointed out, there's section on the website with some extra bits like JPedalFX which is a lightweight JavaFX PDF viewer. There's also PDF to JavaFX functionality in the plugins for Eclipse, NetBeans and IDEA.
We hope to update the JavaFX section in the near future with what we have been working on recently too: http://www.idrsolutions.com/javafx/
JPedal already supports JavaFX, pretty cool actually.
http://www.idrsolutions.com/javafx/

Android UI Tools

Please give me an idea about android User interface design.Is there any tool to design the User Interface? Or Is we need to create XML file manually ? I am really newbie in android application?
Thanks
I recommend you to install the Android sdk, eclipse and ADT(Android development tools) plugin to eclipse and see for yourself. All the information about how to do this is on here.
If you are a beginner I can also recommend you what I think to be the best android development tutorial on the web, the free best one at least, from Marakana.
I think this will tell you all you need to start...
EDIT: I had no time to give a greater answer, so I'm completing it now.
Google has made a big effort to provide a WYSIWYG interface to avoid xml but you will still need to code some stuff. Another great help to avoid xml is the Properties view on eclipse accessible by Window > Show View > Properties or if its not there look for it in the Window > Show View > Other... popup menu. The Outline view accessible through the same menus will help you select between the elements you have on your layout.
All these things combined with the eclipse auto-completion feature and some shortcuts(ctrl + space is your friend) while coding in xml will give you a lot of information about the properties available.
If you are really in the mood to start developing to the android platform the Marakana Android Bootcamp I linked above is going to teach you all the basic stuff and mainly the background you need to look for what you don't know.
Droid Draw: http://www.droiddraw.org/ is one option.
The ADK currently comes with a plugin for Eclipse that lets you do this.
Google has plans to enhance this feature: http://www.youtube.com/watch?v=Oq05KqjXTvs&feature=channel_video_title
On July 6th, version 12 of the ADT (Android Developer Tools) was released and Google has made some big changes to creating RelativeLayout with a WYSIWYG editor. You can check it out around the 26 minute mark of the video posted below.
http://www.youtube.com/watch?v=Oq05KqjXTvs

Is there any website showcasing all of the available UI components and widgets with source code?

I was looking for something like the Visual Guide to Swing Components (Windows Look and Feel).
A page that shows the Android UI components.
Thanks.
Android documentation has a whole section dedicated to User Interface with source code examples. The most important sub-sections are the following:
Declaring Layout,
Creating Menus,
Creating Dialogs.
If you haven't check these, you should.
Furthermore, you also have these:
Hello, Views
A Visual Guide to Android GUI Widgets
Android Development Tutorial

How to convert a java swing application to work on android

So I built a program in Java using swing for the interface and i didn't realize how difficult it would be to convert it to be used as an android application. Is there any way for me to easily convert or rebuilt the program to be sold in the android market place? If not can anyone point me toward any resources to help build a android.
I did the same thing awhile back. Although there is no program out there that I know of to convert it directly. The Java code and the android code are very similar. Since android doesn't use swing's UI it uses XML based UI. once you get the UI functions of the android app down your Java code can be easily imported.
I am working on converting my Java app into an android app now. Most of my classes imported with no problem.
AjaxSwing allows to convert Swing applications and use them directly on android or ipad, see http://www.creamtec.com/products/ajaxswing/solutions/java_swing_ui_on_ipad.html
What I would do is that I would build the UI in XML, then I give the items an ID and reference to it in Java, and then I'll trigger everything by button clicks so what one button does in your swing layout does the same on android. You can't copy/paste it.
swing UI was meant for desktops and pc's but for
android you have to use Xml then you can keep your java codes as they are in the various activities
then use your event handling skills to trigger them
Open the project's properties
Select Java Build Path
Select Libraries tab
From there you can Add External Jars and you can use swing layout

Categories

Resources