Debug mode vs. Release mode

by Brady » Fri, 04 Sep 2009 01:46:07 GMT


Sponsored Links
 Hi everyone,

I'm trying to figure out a way to programmatically determine if my
build was built in debug mode vs. release mode. I'd like to hide some
items in my settings screen if it's release.

When I build my app in Eclipse I'm building by default in Debug mode.
However, when I build the app using the command line, I build it in
release mode and sign the app using the jarsigner tool.

I've tried using
PackageInfo appInfo = manager.getPackageInfo("com.adobe.psmobile",
PackageManager.GET_SIGNATURES);
to test if
appInfo.signatures[0].toCharsString()
matches my debug signature and that didn't seem to work.

I'm now trying to see if I can introspect the app's KeyStore, to match
the default debug alias described here:
 http://developer.android.com/guide/publishing/app-signing.html 
of "androiddebugkey"

but I haven't figured out how to retrieve the app's KeyStore yet.

I'd greatly appreciate it if anyone had any suggestions on how to do
this.
Thanks in advance!
Brady
--~--~---------~--~----~------------~-------~--~----~



Debug mode vs. Release mode

by Pieter » Fri, 04 Sep 2009 13:25:48 GMT


 Hello Brady,

I don't know if this is what you are looking for, but if you use
ant to build your release version you could use the following
technique:

Config.java:
public class Config {
        public static final String BUILD_NAME = "eclipse";
}

build.xml:
<target name="prepare-full">
  <property name="product" value="full" />
</target>

<target name="gather-sources">
<copy todir="${sources}">
  <fileset dir="${srcdir}">
    <include name="com/spectrekking/Config.java" />
  </fileset>
  <filterset recurse="false" begintoken="BUILD_NAME = &quot;"
endtoken="&quot;;">
    <filter token="eclipse" value="BUILD_NAME = &quot;${product}
&quot;;"/>
  </filterset>
</copy>
</target>

<target name="build-full" depends="prepare-full,gather-sources,..."/>

This will replace 'BUILD_NAME="eclipse";' with 'BUILD_NAME="full";' in
Config.java during
a production build, allowing you to easily check the version. This
technique can then also
be used to differentiate between full and light builds (and in our
case the adc2 version).

Regards,
Pieter.



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Debug mode vs. Release mode

by Andrei » Sat, 05 Sep 2009 10:32:19 GMT


 how about android.util.Config.RELEASE?



--~--~---------~--~----~------------~-------~--~----~



Debug mode vs. Release mode

by Brady » Sun, 06 Sep 2009 08:26:13 GMT


 Hi Peter,

thank you for the suggestion. Yes we are using ant. We already use
some scripting like that to update a build java src. I'm not sure if
we'd add that to the build.xml (because it's autogenerated) but we
could update a static like you suggest.

Any ideas if we can compare the debug key vs. release?

Cheers,
Brady




--~--~---------~--~----~------------~-------~--~----~



Debug mode vs. Release mode

by Brady » Sun, 06 Sep 2009 08:29:17 GMT


 Sorry, I misspelled your name. Thank you Pieter!
--~--~---------~--~----~------------~-------~--~----~



Debug mode vs. Release mode

by Andrei » Sun, 06 Sep 2009 10:14:40 GMT


 can you use Config.DEBUG?



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Sharing code between activities

I have an app with two activities.

Both activities among other functions have to perform the same
calculation on data, so each activity include the same code to perform
the calculation.

Is it possible to only have the similar code in a separate activity
and be accessed by the other two activities instead of duplicating the
code twice?

Thanks
Amiz
--~--~---------~--~----~------------~-------~--~----~

2. Lost control over my device :/

Hi Folks.
I am trying to port android to a yet non supported phone (meizu m8)
This is a WindowsCE 6 phone, so we did quite bad things to get a
kernel up and running.
We ended with having a booting kernel with the drivers (nand and mmc),
which is flashed by us through the std. windowsce update machanism.
So i build a nfsroot with android init and bootetd that thing.
It didnt startet, and it tryed to mount some partitions it found
(called mtdblock4) with yaffs2. This failed, because there wasnt
yaffs2 filesystem. I wanted it to boot form movinand which had a
partition.
How bad, on mtdblock4 was my windows ce upgrade program.
Now i left with a device which starts a linux kernel, loads the driver
mounts an nfsroot and nothing else.
I cant get back to my original meizu os because adnroid killed the
flashimage of this.
My question is now: What can i do to get my system back to life?
I thought about just dding a binary image of my upgradetool to where
its expected, but when i add anything to init.rc like dd ... nothing
happens.
I put a busybox binary in my rootfs and tried to add
exec /install/bin/sleep 10s
or
exec/_install/bin/busybox sleep 10s
but it just ignored it. Why does init.rc ignores my commands?
So i cant get back my system to run

So anyone has good tip how to get control to my device back (either in
the android or back in the windows way) so i can continue porting?
any help would be appriciated

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Can i specially forbids switching orientation when rotating phone on my app?

4. connecting to a remote database tutorial/example?

5. updatePeriodMillis not working for widget on 1.6

6. disable soft keyboard from auto-completion

7. removing the dictionary from the ime