Building nbandroid 1.1 project with the latest nbandroid 1.5, converting project.

  11 posts   Feedicon  
Replies: 10 - Last Post: April 29, 2011 21:24
by: sblantipodi
showing 1 - 11 of 11
 
Posted: April 20, 2011 21:31 by sblantipodi
Hi all,
I have updated the nbandroid 1.1 to 1.5.

Now all is changed and I don't find a way to build an unsigned APK.

With nbandroid 1.1 to create an unsigned APK I used to add this lines:

<target depends="init,-package-res-and-assets,-package-res-no-assets,-package-dex" name="-no-sign">
<exec executable="${apkbuilder}" failonerror="true">
<arg value="${basedir}/${dist.apk}"/>
<arg value="-u"/>
<arg value="-z"/>
<arg value="${basedir}/${dist.apk}_"/>
</exec>
<delete file="${dist.apk}_"/>
</target>
<target depends="init,compile,-pre-jar,-dex,-package-res-and-assets,-package-res-no-assets,-package-dex,-no-sign,-post-jar" description="Export unsigned package" name="unsigned"/>

to the project.xml file, how can I create an unsigned apk now?

There is also a warningwhen I build my project:
"C:\Program Files (x86)\android-sdk-windows\tools\ant\main_rules.xml:384: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds"

What is this?

Please help.
 
Posted: April 21, 2011 06:43 by radim
Hi,

  1. You've updated from 0.11 (or 0.x) to 1.x.
  2. Just build your project. It calls 'ant debug' and the apk you're looking for. Most of new project infrastructure is a wrapper around standard set of tools desribed in http://developer.android.com/guide/developing/building/building-cmdline.html
  3. See http://kenai.com/projects/nbandroid/pages/FAQ for a workaround for the warning that you get during the build.


-Radim
 
Posted: April 22, 2011 23:59 by sblantipodi
Hi,
thanks for the reply Radim, I really appreciate it and I really appreciate your excellent work,
we are proud to use Android SDK into Netbeans and this is thanks to you.

Now I don't remember if I used nbandroid 1.1 or 0.11, I used the latest available from here:
http://kenai.com/downloads/nbandroid/updates.xml

Now I'm using the latest 1.5 from here
http://deadlock.netbeans.org/hudson/job/nbandroid/lastStableBuild/artifact/build/updates/updates.xml

But I haven't understood how to use this plugins.

In the previous version, when I build a project I can see the apk file into the dist directory,
adding some lines into the project.xml file was enough to create an unsigned apk into the dist directory.

Sincerely now I cannot understand how to "automatically" create an unsigned APK after a clean and build from netbeans.
Now with the new plugin I find three files in the BIN directory:
myproject.ap_
myproject-debug.apk
myproject-debug-unaligned.apk

This files have really different size with the one generated with previous plugin, it is way much bigger.
What is the unsigned APK here?

Hope that someone can help.

Thanks!
 
Posted: April 25, 2011 00:12 by skor16
Hi,

I used to do the same thing for building an unsigned apk and I had the same trouble with the new 1.5 version of the android plugin.

My current workaround is to :
- unzip the ap_ in a directory
- add classes.dex from the bin directory into the same directory
- zip all files of the directory.
- rename zipped file as .apk

This produce an usigned apk that can be signed to upload to the android market.

I hope this help.

Best regards

Pierre
http://www.androidsoft.org
 
Posted: April 25, 2011 10:51 by sblantipodi
Hi,
thanks for the reply.

I haven't understood why we need to do all this to create an unsigned apk,
this is not acceptable for me and it doesn't seem really "efficient".

Is there any possibility to get the "good old way to create unsigned apk" again?
 
Posted: April 25, 2011 19:45 by radim
What you want to do is to run 'ant release'. One way how to do it directly from the IDE is to:
  • Expand 'Important Files' node
  • Right-click build.xml and select Run... | Advanced
  • Type release as a target name (it will be in the popup next time)
  • Run


It is possible that we can enhance the build.xml node in Android projects to show some important targets. Long term we need to add project configurations. Then you'll be able to switch between debug and release config for building and testing.

-Radim
 
Posted: April 26, 2011 12:20 by sblantipodi
Many thanks for the help radim, I really, really appreciate it.
Can you tell me please why the unsigned APK now is a lot bigger than the APK generated with previous plugin?

The APK generated with previous plugin was 188KB,
now it is 201KB. Can you tell me why please?

Thanks!
 
Posted: April 26, 2011 16:44 by radim
Honestly I do not know what is the reason for this 7% increase. You can turn on verbose Ant output and look how it is built and what goes in to find out.

-Radim
 
Posted: April 26, 2011 21:53 by sblantipodi
thanks for the reply, again.

this is really strange.
zipalign was done automatically with the previous plugin, right?
 
Posted: April 28, 2011 17:12 by sblantipodi
Do you know if zipalign was done automatically in the previous plugin version 1.1?

I noticed an increments in size of 10% in other apps when compiling using the latest plugin.
This is strange and I can't find a reason of this increment, now I'm not really confident to
put this APK in "production".

Can I be sure that is all ok? No idea on the reason of this big increment in size?
 
Posted: April 29, 2011 21:24 by sblantipodi
is there someone who can tell me if previous nbandroid 0.11 zip aligned the apk automatically?

I'm not confident anymore of releasing production software with this plugins, too large deviations of apk size from one release to another, and the worst thing is the no one knows why Frown
showing 1 - 11 of 11
Replies: 10 - Last Post: April 29, 2011 21:24
by: sblantipodi
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close