How-to debug native code with Android

http://www.lakecharlesclinicaltrials.com/english-poem-my-doggy-ate-my-homework/ english poem my doggy ate my homework This is a step by step guide for executing and debugging native code on Android with Eclipse.

report writing services

1. Prerequisites

http://profisvet.com/do-thesis-graduate-school/ do thesis graduate school The SDK version used for this guide is Froyo with the NDK r4b ( crystax release ).
Also Eclipse CDT plugin it’s very useful for our purposes, so install it.
Last plugin to install it’s the Sequoyah plugin for Eclipse.

2. Project setup

andrews university seminary doctoral dissertation series At this point let’s create a new Android project, name it “Example” and use the “com.darkwavegames.com” package name, add also an Activity name of your choice.
Select Android 2.2 as base SDK version and complete the project wizard.

diythemes thesis video Now you need to add the native support for the newly created project. Just right click on the project root element in the package explorer and select “add native support”.

http://tahupac.org/dissertation-services-uk-aachen/ dissertation services uk aachen In the next dialog write the path of your NDK folder and give also name for your library.
After this operation a new folder “jni” will be created with a .cpp file, header filer and an Android makefile, Android.mk, which can be edited to modify all the includes, linker and compiler options. In the Android.mk file you also need to specify all the source file you want to use within the LOCAL_SRC_FILE directive.

3. Debug

http://www.originalmediadesign.com/topics-for-biology-research-paper/ topics for biology research paper In order to enable debug of native code in Android you have to face different problems, based also on the device and the firmware version, and if the native code is multi thread or single thread.
First of all you need to mofify the Chemistry Help Oxidation Numbers AndroidManifest.xml file adding the attribute “debuggable” to true ( remember also to enable the “Debug USB” option under the Application device menu ).
At this point you can debug all the java code within your eclipse debugger, for for the native C debug you need more steps.

http://ucmother.ac.ae/?presentation-of-a-business-plan presentation of a business plan Continue reading

Disable asset compression with Android aapt

http://www.papilouve.com/writing-essays-about-literature/ writing essays about literature Trying to embed all the assets resources into my final apk was not so easy as I tought.. at least using the ADT Eclipse plugin for building project.
In fact, using AssetManager.openFd to return to the C++ code a FileDescriptor does not work with compressed sources.
When aapt compile the resources into the apk file it compress by default all the files which extensions are not recognized and those which recognize as text files.

http://www.visiteday.com/?online-dissertation-and-thesis-tada online dissertation and thesis tada These are the extensions not compressed:

http://www.ecopubblicita.it/custom-lab-report/ custom lab report

1
2
3
4
5
6
7
8
9
<br />
static const char* kNoCompressExt[] = {<br />
".jpg", ".jpeg", ".png", ".gif",<br />
 ".wav", ".mp2", ".mp3", ".ogg", ".aac",<br />
 ".mpg", ".mpeg", ".mid", ".midi", ".smf", ".jet",<br />
 ".rtttl", ".imy", ".xmf", ".mp4", ".m4a",<br />
 ".m4v", ".3gp", ".3gpp", ".3g2", ".3gpp2",<br />
 ".amr", ".awb", ".wma", ".wmv"<br />
};<br />

http://www.cnom.sante.gov.ml/x/sacred-paths-essays-on-wisdom-love-and-mystical-realization/ sacred paths essays on wisdom love and mystical realization I was looking into the .project file of my Eclipse project but it seems that changing things inside that file ( like values into the tag ) does not affect the builder.

http://www.siproferrara.com/?custom-essay-writing-uk custom essay writing uk The first thing I tried was to remap the aapt executable using a shell script ( and renaming the original aapt file into _aapt ):

1
2
3
4
5
6
7
8
9
10
11
12
<br />
#!/bin/bash</p>
<p>strParams=""<br />
CWD=’dirname $0’</p>
<p>for i in $@; do<br />
   if [ $i = "-S" ]; then<br />
      strParams="$(echo $strParams) -v -0 \"\""<br />
   fi<br />
   strParams="$(echo $strParams) $i"<br />
done</p>
<p>tool="$CWD/_aapt $strParams"<br />
$tool 1>&2<br />

archive of dissertation abstracts in music In fact, when building the project in eclipse I could see the whole output, but the files are still being compressed, even if I call the same command in a shell the assets aren’t compressed.
I haven’t yet find a solution so for the meantime I decided to use ant to build my project overriding the default “-package-resources” target in this way:

cialis 200 mg india

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<br />
    <target name="-package-resources"><br />
        <echo>Packaging resources</echo><br />
      <echo>${asset.absolute.dir}</echo><br />
        <aapt executable="${aapt}"<br />
                command="package"<br />
            verbose="${verbose}"<br />
                versioncode="${version.code}"<br />
                manifest="AndroidManifest.xml"<br />
                assets="${asset.absolute.dir}"<br />
                androidjar="${android.jar}"<br />
                apkfolder="${out.absolute.dir}"<br />
                resourcefilename="${resource.package.file.name}"<br />
                resourcefilter="${aapt.resource.filter}"><br />
            <res path="${resource.absolute.dir}" /><br />
            <nocompress /></target></p>
<p>    <br />

http://akada.org/k-12-research-paper/ k 12 research paper In this way the project is being compiled correctly and all my assets are embedded not compressed!

http://www.falydelaferiaalrocio.com/dissertation-editors-south-africa/ P.S. my claim token is: 7C8AATS7Q5A3

Amethyst Actionscript editor

fast write assignment amethyst screenshotIt’s since the first time I used Eclipse that I’m waiting for an actionscript editor non eclipse based!

I never like eclipse and hated all its problems.
Unfortunately Adobe decided to implement its editor over eclipse and also other nice editors, like fdt, used the eclipse framework to build their own editors.
I used Visual Studio for a while but that was enough to make me fall in love with it.
Visual Studio is indeed the best editor at all, without doubts!
Finally I discovered an interesting project for editing actionscript projects integrated into Visual Studio.
Amethyst is still in beta and probably too premature to be used in large production environment, but it’s a great news for me.
I hope they’ll continue in the development and create a serious competitor for Flash Builder.
For more info visit their product page: http://www.sapphiresteel.com/Amethyst-Product-Page

An experience with antlr, java and python

http://admisiones.uprrp.edu/wp-content/?essay=650&writingservice=online-essay-editor online essay editor I just wanted to share a little experience with generating an AS3 parser using antlr and python.
I was trying first to create the parser using GNU Flex and Bison in C, probably the best way for a very performancing parser.
Yeah, that’s right.. but looking at the antlr syntax I realized that’s easier and easier.
Moreover I start using this very useful eclipse plugin for antlr debugging which made my life easier!

follow url The grammar file I created is a compromise between the asdt grammar file and the ECMA-262 grammar specification.

click here Once finished working on my eclipse project I’ve managed to parse succesfully all the adobe corelibs files using this java test file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package org.sepy.core.parsers.as3;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import antlr.CommonAST;
import antlr.RecognitionException;
import antlr.TokenStreamException;
public class Application {
public static void main(String argv[])
{
if(argv.length &gt; 0)
{
File file = new File(argv[0]);
if(file.exists())
{
FileInputStream is = null;
try {
is = new FileInputStream(file);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
AS3Lexer L = new AS3Lexer(is);
AS3Parser P = new AS3Parser(L);
try {
P.compilationUnit();
} catch (RecognitionException e) {
// TODO Auto-generated catch block
System.out.println(" line=" + e.line + ", column="+ e.column);
System.out.println(e.getMessage());
e.printStackTrace(System.err);
} catch (TokenStreamException e) {
// TODO Auto-generated catch block
System.out.println(" line=" + L.getLine() + ", column="+ L.getColumn());
System.out.println(L.getGuessInfo());
System.out.println(e.getMessage());
e.printStackTrace(System.err);
}
CommonAST.setVerboseStringConversion(false, P.getTokenNames());
CommonAST ast = (CommonAST) P.getAST();
System.out.println("Tree:");
System.out.println(ast.toStringTree());
}
}
}
}

watch Ok, done that I decided to export the grammar file for python (thanks to antrl python export feature).
Everything works fine also for python, but I realized that the python script were so much slower than the java one!

1
2
3
4
5
6
7
8
9
10
11
12
import sys
import antlr
import AS3Parser
import AS3Lexer
L = AS3Lexer.Lexer(filename);
P = AS3Parser.Parser(L);
P.setFilename(filename)
try:
   P.compilationUnit();
   ast = P.getAST();
except:
   pass

here On a 75Kb actionscript file the python script took about 7 seconds to run, while the java application only 2 seconds. I know python interpreter caould be slower than many other languages, but I never thought so much slower.
So I run the python hotshot profiler to see which could be the bottleneck in the python script and I found most of the problems were due to unuseless antlr (the python module) method’s calls.
After making corrections to the antlr.py file the same script took exactly half of the time. Now 3 seconds. Wow 🙂
But not fast enough.
So I enabled for the antlr python script psyco module and this time the same script took Phd Thesis Of Political Science only 1.6 seconds.
Now the python script is fast enough, even if I’m sure I can make more optimizations in the antlr module…

Flying away… holidays!!

follow link Before leaving for my holidays i just want to make a quick post about the recent SE|PY additions…

1. Quick search bar

sepy quick search

http://bnteams.com/?p=dissertation-mineral-saratoga-water The new “quick search” bar at the bottom. Thanks to Eric Dolecki who suggested me a more usable and fast to use “search” control (thanks also to Eric new icons suggestions!)
I use Mozilla Firefox from more than one year, i love the way it has implemented the find bar, and I never thought at using it in SEPY? yes.. that’s true 🙂

2. Right border enhancement

here This is directly taken from an Eclipse feature i like a lot.
For every bookmarked line or line with a “TODO” comment you will have in the right side of each document a small clickable rectangle, with different colors, which show you the absolute position of that line in the document.
When you move the mouse over that rect you will see a tooltip telling you the content of the line and click on it for move to that line.
Nothing particular, but I found it really useful.
It’s now possible to customize the words SEPY is looking for (not only “todo”, but what you want)
Moreover, with the last addition of a sqlite database once you open a document for the second time you will see all the previous bookmarked lines, and the cursor will be placed in the same position you previously closed the document.

MTASC compile

http://ariesinternational.co/?p=how-to-write-a-proposal-on-obesity Last addition is the mtasc compile dialog.
Using this dialog window you can compile yuor script in SEPY using the mtasc compiler and see in the same dialog a preview of the created SWF.
BTW, I will leave for my holidays on Monday (destination Tallinn, Estonia).
See ya again by the end of August.. and great holidays to you all!!
http://sourceforge.net/

Flash Platform Announcement

click here This morning Macromedia made several press announcements regarding the Flash Platform, Flash Player, Macromedia’s support of the Eclipse Foundation, and an upcoming toolset for Flex development, code-named Zorn.

http://geochimie.fr/?p=written-bibliography http://www.macromedia.com/go/platform

Update on SEPY 2

buy essay problems As I announced some time ago the project for re-writing from scratch SEPY is already started..
actually the framework is quite complete and at the state of art it’s a full basic text editor. Today I met Gabriele, the same guy who helped me in the preliminary phases of sepy1, and we decided some of the new SEPY2 guidelines and how we want to proceed..
SE|PY 2 will be made using a similar, but more more simpler, process as the one used by Eclipse, that is plugin based.
This can help us, but also everyone who want to extend it in the future, with panels (which will be completely independent from the main application), and document classes.
As regarding panels we’re still thinking at the best solution for the workspace management.. maybe a solution similar to the one used by Macromedia software.
any preference here?

http://digitalradio.com.au/?p=college-application-essay-help-online-rutgers BTW, the very first thing in the TODO list it’s indeed the autocompletion system, which must be written as powerful as possible, thus mantaining good performances. This is the first and the core feature, without that the editor could not live…

http://hstrebatestoronto.com/?p=buy-tok-essay-online Other important features will be the support for Flex and all XML in general, maybe using DTD for the autocompletion (for xml files)…

http://masheroa.com/assessment-students/ If it will be possible, we have thought also in extending scintilla functionallity in order to have a custom lexer for “.as” files, with extended folding and colouring features.
for example:
//#region

//#endregion
will create automatically folds region…

click I hope that basing on the experienced I made with python in the last 2 years and thanks to all the feedback I received during this period to be able to create a better tool for developing flash..