khammong / android-vnc-viewer

Automatically exported from code.google.com/p/android-vnc-viewer
0 stars 0 forks source link

How to build properly #282

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi there,

First of all thank you for this great app. It works well without much hassle.

However, I still couldn't figure out the proper way to build it. I've added 
SQLiteGen and have actually managed to build and run it on the emulator a 
couple of times.

Using Eclipse, I have imported the projects. ZoomerWithKeys builds fine. Here's 
some of the problems I have with androidVNC
- Sometimes it builds but during launch, it would throw an exception saying 
that it was unable to load the Zoomer class
- Sometimes it builds but during launch it would complain about being unable to 
find androidVNC class on the classpath
- Sometimes it says that gen/android.androidVNC/R.java is already defined (In 
this case, I remove Java builder from builders and this error goes away)
- Sometimes it won't produce the SQLiteGen files such as AbstractConnectionBean 
or MostRecentBean (although SQLiteGen is enabled in the build).

I believe after a proper build, those SQLiteGen files should be placed under 
src/ not gen/. Usually they appear under /gen but sometimes I've managed to 
have it produced under /src as well and it worked.

As you can see, I run into different kinds of problems and I typically do a mix 
of
- Running build.xml with clean
- Running build.xml with debug
- Building project with all builders enabled
- Building project with all builder but Java builder enabled
- Cleaning the project (from within Eclipse)
- Removing gen directory
- Removing only gen/android.androidVNC directory
...

I had no problems with the apk's but for a project of mine, I need to be able 
to edit the source slightly so I have to build it. Would appreciate it a lot if 
you could point me to the correct way of building and running the project. (You 
might want to add somewhere in this website that SQLiteGen is required as well, 
it took me couple of hours to figure that out)

Thank you,
Ege

Original issue reported on code.google.com by egeakpi...@gmail.com on 8 Dec 2011 at 4:29

GoogleCodeExporter commented 9 years ago
I'd very much like to see a short write-up of how to build androidvnc from 
scratch, using eclipe. I need a few mods that I can apply myself but I've been 
unable to get the thing built.

Original comment by jvrom...@gmail.com on 13 Jan 2012 at 7:07

GoogleCodeExporter commented 9 years ago
Here's a few tips that may be useful

1- You need SQLLiteGen tool. It automatically generates files based on 
interface files. (If you get like many missing file errors, that's most 
probably because these automatically generated files are missing)
2- You have to build this external project called Zoom something separately. 
First build it and once it's built, you can carry on to the main project.
3- I first clean the main project and then build it (with SQLLiteGen turned 
on). Then build it again (yes, build twice). Then it complains about R.class 
file (under generated/ folder). Remove R.class file (delete it) and then go to 
project properties. Under Builders, de-select Java builder. Now run the code, 
hopefully it should run.

And everytime you want to make a code change
Enable Java builder
Make your code change
Clean the project
Build the project twice (with SQLLiteGen enabled)
Disable Java builder
Run the project

A few remarks
- I managed to get it all running through Eclipse commands (build, clean). I 
didn't need to use makefiles at all.
- Building twice is necessary because during first build SQLLiteGen files get 
created (after many build errors). During second build, now that SQLLiteGen 
files are generated, those errors go away. (Although it should be possible to 
re-order the builders so that SQLLiteGen generation takes place before Java 
build. You can try it through Project->Properties->Builders and put SQLLiteGen 
before Java builder. Haven't tried it myself)
- For some reason, R.class gets created twice (I believe it's because we have 
the main project as well as the external Zoom.. project and they both try to 
generate R.class. Just a wild guess though) You have to disable Java builder to 
avoid this (but Java builder is necessary for you to apply your code changes so 
disable Java builder only after you've built all remaining files and are ready 
to run)

Cheers
Ege

Original comment by egeakpi...@gmail.com on 15 Jan 2012 at 11:47

GoogleCodeExporter commented 9 years ago
I've added SQLiteGen to the projects. So there are three now: 

androidVNC
SQLiteGen
ZoomerWithKeys

I can build SQLiteGen and ZoomerWithKeys.

Project androidVNC shows (Properties > Builders):

Missing builder (com.antlersoft.bbq_eclipse.BBQBuilder)
Missing builder (com.antlersoft.sqlitegen.SQLiteGenBuilder)

Apparently I'm missing something else.

Original comment by jvrom...@gmail.com on 15 Jan 2012 at 6:50

GoogleCodeExporter commented 9 years ago
I was able to get mine to build after some poking and prodding.  Here is what I 
did:

1)  Follow the install directions for the SQLiteGen here -- 
http://code.google.com/p/sqlitegen/

This is a helper plugin for Eclipse that generates some Abstract .java files 
that androidVNC uses.  Oddly enough, I didn't seem to have to add 
com.antlersoft.android.db_xxx.jar to the build path of androidVNC to make it 
work.  The needed files were still put under the /gen directory.

To carry out the following two steps, go to Project->Properties->Android and 
change the respective Build Targets.  My build targets were not set, so I had 
to set them manually.  If yours are pre-set to something >= API level 8, 
disregard the next two instructions.

2)  Set the ZoomerWithKeys build target to 4 (appears to be arbitrary for this 
particular project, as long as its at a minimum of three).  I used the Google 
APIs version.

3)  Set the androidVNC build target to 10.  It will warn you that the 
attributes are lower than the project target API level, this is okay.  This app 
uses several attributes within the AndroidManifest.xml that require >= level 8 
API (android:installLocation, for example).  

4)  The Java compiler compliance level appears to default to 1.5 for the 
androidVNC project.  This causes a whole host of problems involving the keyword 
'@Override'.  To fix this, go to Window->Preferences->Java->Compiler->Configure 
Project Specific Settings (upper right hand part of the preferences window).  
Select androidVNC as the project to configure.  Change the "Compiler compliance 
level" to 1.6.

Note:  If androidVNC is not showing up as a project to configure in the new 
window, return to the main eclipse window, then right click the androidVNC 
project->Android Tools->Fix project properties.  This will allow it to build 
with a multitude of errors, then allow you to select androidVNC to be changed 
for step 4.

With these particular changes, I haven't run into any issues.  I made sure to 
build both ZoomerWithKeys and androidVNC together, which seemed to happen 
smoothly.  It's running on my NexusOne right now!

Original comment by mos...@gmail.com on 25 Jan 2012 at 12:42

GoogleCodeExporter commented 9 years ago
Thank you very much for the suggestion - disable java builder. It worked in my 
case. I am trying to make a signed build of Android VNC viewer.

Original comment by satish67...@gmail.com on 19 Mar 2013 at 8:08

GoogleCodeExporter commented 9 years ago
So whenever you want to run the project in eclipse or build a signed/unsigned 
apk (export a signed/unsigned apk) , make your code changes and build the 
project twice with "Java Builder" enabled , and then disable "Java Builder" and 
run the project in eclipse or export a signed/unsigned apk

Original comment by satish67...@gmail.com on 19 Mar 2013 at 8:16

GoogleCodeExporter commented 9 years ago
Here's how I got it working:

1 - Install  SQLGenLite http://code.google.com/p/sqlitegen/

2- Make sure you you change the link of the ZoomerWithKeys_src file to the src 
of the Zoomer Project.

3- Copy the Zoomer resource files into the androidVNC resource folder. Do not 
overwrite any AndroidVNC resources. 

4- Build Twice, and run.

The problem I was having before I copied the resource files is that I could 
compile and start the program but as soon as I clicked connect, the program 
would crash. 

Original comment by PhilipSa...@gmail.com on 19 Apr 2013 at 8:25