Bitmap formats

by Neil » Thu, 21 Jan 2010 23:33:32 GMT


Sponsored Links
 There are several bitmap formats:
ALPHA_8, ARGB_4444, ARGB_8888 and RGB_565
but where are they described?
How am I supposed to know which one to use?

Regards

Neil



Other Threads

1. Cannot get Log.isLoggable working as documented

This is a very simple problem and I've searched to find that no one
else seems to be having it, anyway...

My code is something like:

if (Log.isLoggable("mytag", Log.DEBUG)) {
    Log.d("mytag", "Logged at debug level");
}

The documentation says that by default logging is enabled at INFO
level. This appears to be correct, since the above IF condition
evaluates to false. Also, replacing Log.DEBUG with Log.INFO, means it
evaluates to true as expected.

However, if we remove the if statement then shouldnt the Log.d()
statement do nothing?

Next, when I follow either of the two documented methods for changing
the default logging level neither of them work:

1. I open up a terminal (through Dev Tools) and type "setprops
log.tag.mytag DEBUG". Then I debug my app (through eclipse) and the
isLoggable call above is still evaluating to false

Side question: What is the lifespan of that setprops call?

2. I placed a new file called "local.prop" in the /data folder. The
file contains one line: "log.tag.mytag=DEBUG".

Side question: The documentation says to place the "local.prop" file
in "/data/local.prop" which is not clear. I assume it does NOT mean
create a folder called "local.prop" and place a "local.prop" file in
that folder.

So neither of those work for me. What am I doing wrong? Is eclipse
somehow overriding my settings?
--~--~---------~--~----~------------~-------~--~----~

2. Traceview OutOfMemory error

Hello. I have been trying to use traceview for profiling my Android
app. So far I have gotten it to work on very small parts of the
program. If I use it for bigger chunks it creates too much information
(.trace file is too large) and I get an OutOfMemory (heap memory)
error from the java compiler. I tried some tricks with setting higher
min and max heap memory values but no luck.

If anyone has used traceview with similar effects before I would
highly appreciate any tips you may have.

Here are the details. First I am reproducing the error message:

$ traceview.bat tmp.trace
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
        at com.android.traceview.TimeLineView.setData
(TimeLineView.java:433)
        at com.android.traceview.TimeLineView.<init>(TimeLineView.java:
316)
        at com.android.traceview.MainWindow.createContents
(MainWindow.java:93)
        at org.eclipse.jface.window.Window.create(Window.java:426)
        at org.eclipse.jface.window.Window.open(Window.java:785)
        at com.android.traceview.MainWindow.run(MainWindow.java:58)
        at com.android.traceview.MainWindow.main(MainWindow.java:190)


On windows traceview works from a batch file that is reproduced below.
The last line is where I am mucking with the memory settings. That
does not seem to affect the behavior though. The parameters-- -XX:
+HeapDumpOnOutOfMemoryError -Xms2g -Xmx2g-- have been added by me ...
again they have no effect. Maybe because they should be used when
generating the .jar file itself?


//////////// traceview.bat /////////////////////////
rem don't modify the caller's environment
setlocal

rem Set up prog to be the path of this script, including following
symlinks,
rem and set up progdir to be the fully-qualified pathname of its
directory.
set prog=%~f0

rem Change current directory to where traceview is, to avoid issues
with directories
rem containing whitespaces.
cd %~dp0

set jarfile=traceview.jar
set frameworkdir=
set libdir=

if exist %frameworkdir%%jarfile% goto JarFileOk
    set frameworkdir=lib\
    set libdir=lib\

if exist %frameworkdir%%jarfile% goto JarFileOk
    set frameworkdir=..\framework\
    set libdir=..\lib\

:JarFileOk

set jarpath=%frameworkdir%%jarfile%

C:\Program Files\Java\jdk1.6.0_12\bin\java -XX:
+HeapDumpOnOutOfMemoryError -Xms2g -Xmx2g -Djava.ext.dirs=%frameworkdir
% -Djava.library.path=%libdir% -jar %jarpath% %*
//////////////////////////////////////////////

Cheers, Boris

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

3. cerrno equivalent in android

4. cupcake + wifi ad hoc on a g1 dream

5. Resistive Multitouch...

6. SensorListener and MediaPlayer (Audio)

7. Skype Lite Intent Mangement