Create project from existing source

  7 posts   Feedicon  
Replies: 6 - Last Post: October 18, 2010 14:58
by: Jacob Nordfalk
showing 1 - 7 of 7
 
Posted: July 26, 2010 23:07 by gshyde
While it's easy to create a new project from scratch there is no way to create a project from existing source code. This would be extremely useful first to new users who want to create projects from the examples and second to active users who don't save project files in version repositories.
 
Posted: August 19, 2010 08:30 by Jacob Nordfalk
+1 for this.

I am a teacher in Android programming.

In the learning process, students will try out a lot of projects from the book
(Hello Android, 3.ed. - http://www.pragprog.com/titles/eband3/hello-android).

I'd really like to use Netbeans as teaching platform, but not being able to import existing projects is a showstopper for this. A big pity, as the Eclipse environment (which we will be forced to work with) IMO is much less suited for students than Netbeans.

Jacob
 
Posted: August 19, 2010 08:52 by Jacob Nordfalk
Ive added a feature request.

Please vote for http://kenai.com/jira/browse/NBANDROID-72

Jacob
 
Posted: August 21, 2010 15:02 by jarome
I am trying to use the Hello Android book also. But with NetBeans, I do not see the equivalent of the generated Java file R.java.
It would be really useful if someone from this project would do a Wiki item that explained how to do things in Kenai vs Eclipse.
Thus far, I can't do anything for Android using NetBeans because of this disconnect.
 
Posted: September 30, 2010 07:28 by Jacob Nordfalk
Jarome,

Please note that you currently CANNOT create a project from existing source. That means, you cannot try the examples from i.a. "Hello Android" in Netbeans, so you have to explain more in detail what you are trying to do.

BTW nbandroid currently (when http://kenai.com/jira/browse/NBANDROID-65 is fixed that might change) generates R.java in the src/ folder.
So just rebuild your project to (re)generare R.java.

The gen/ folder (where eclipse puts it) is totally ignored. This also means that if you later on want to switch from Netbeans to Eclipse you must delete R.java in the src/ folder (or else there will be one in both src/ and gen/).

Updating the wiki would be a great idea. I'd like to do that if I can get write access.

Jacob
 
Posted: September 30, 2010 08:16 by Jacob Nordfalk
Ive made a small script to fix this, until .


Works on Linux and probably also Mac.

Generated projects works also on Windows.

Install: Download make_nbproject.tgz from http://kenai.com/jira/browse/NBANDROID-72
Unpack the file in your _home_ folder:

cd ~
tar -xzvf make_nbproject.tgz


Use: Now go to a directory with samples you want to open in Netbeans. For example:

cd android/android-sdk-linux_86/samples/android-8/Notepad/


Execute the script:

~/bin/make_nbproject


In Netbeans, choose File | Open Project and open it. The Android platform is called "Android", you will probable want to change that (Project Properties | Libraries).




To mass convert a lot of projects, you can do e.g.

cd android/android-sdk-linux_86/samples/android-8/
for i in *; do (cd $i && ~/bin/make_nbproject && cd ..); done


Jacob
 
Posted: October 18, 2010 14:58 by Jacob Nordfalk
Ive uploaded an archive with Netbeans enabled projects for "Hello Android" at

http://vikitraduko.saluton.dk/eband3-code-netbeans.tgz

Ive got permissions from the Author:
http://forums.pragprog.com/forums/152/topics/7095

Jacob
showing 1 - 7 of 7
Replies: 6 - Last Post: October 18, 2010 14:58
by: Jacob Nordfalk
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120127.ac94057)
 
 
Close
loading
Please Confirm
Close