MakeFile - Dependencies

you can find here some info about writing correct MakeFiles

http://www.chemie.fu-berlin.de/chemnet/use/info/make/make_4.html


the option i was looking for is how to create depndency between files that exist in other projects.
the solution is to use VPATH in the makefile.

VPATH: Search Path for All Dependencies


enjoy 
Yaniv Tzanany



Monday, February 24, 2014

CCache - speed C++ compiler output

ccache is a compiler cache. It speeds up recompilation by caching previous compilations and detecting when the same compilation is being done again. Supported languages are C, C++, Objective-C and Objective-C++.

to make it work on aix with xlC_r compiler  , i used the next steps:

i download the sources and compile them on aix via g++ compiler
i copied the output ccache program into my build machine.

i set the next environment to make support xlC_r compiler:
 export CCACHE_EXTENSION=i     (this tell the compiler to generate preprocessor file with i extension)


helper settings FYI:
export CCACHE_DISABLE=1   (to avoid using ccache)
export CCACHE_LOGFILE=/yaniv/ccachelog.log  (to see ccache log)


enjoy
Yaniv Tzanany


Sunday, February 16, 2014

android long press timeout

The default time out is defined by ViewConfiguration.getLongPressTimeout().

You can implement your own long press:

boolean mHasPerformedLongPress;
Runnable mPendingCheckForLongPress;

@Override
public boolean onTouch(final View v, MotionEvent event) {

    switch (event.getAction()) {
        case MotionEvent.ACTION_UP:

            if (!mHasPerformedLongPress) {
                    // This is a tap, so remove the longpress check
                    if (mPendingCheckForLongPress != null) {
                        v.removeCallbacks(mPendingCheckForLongPress);
                    }
                // v.performClick();
            }

            break;
        case  MotionEvent.ACTION_DOWN:
            if( mPendingCheckForLongPress == null) {
                mPendingCheckForLongPress = new Runnable() {
                    public void run() {
                        //do your job
                    }
                };
            }


            mHasPerformedLongPress = false;
            v.postDelayed(mPendingCheckForLongPress, ViewConfiguration.getLongPressTimeout());

            break;
        case MotionEvent.ACTION_MOVE:
            final int x = (int) event.getX();
            final int y = (int) event.getY();

            // Be lenient about moving outside of buttons
            int slop = ViewConfiguration.get(v.getContext()).getScaledTouchSlop();
            if ((x < 0 - slop) || (x >= v.getWidth() + slop) ||
                (y < 0 - slop) || (y >= v.getHeight() + slop)) {

                if (mPendingCheckForLongPress != null) {
                    v. removeCallbacks(mPendingCheckForLongPress);
                }
            }
            break;
        default:
            return false;
    }

    return false;
}

Saturday, February 15, 2014

View source from odex file

copy the framework directory from the android you get the odex file.

  • /system/framweork copy to D:\MyStuff\Android\odex_deodex\l5-framework


open cmd  - and run the next commnads
cd D:\MyStuff\Android\odex_deodex

java -jar baksmali-2.0.2.jar -d D:\MyStuff\Android\odex_deodex\l5-framework -x d:\temp\YouTube.odex
the generated file go-to out folder by default.

now lets convert the out folder to dex file :
java -jar smali-2.0.2.jar  -o classes.dex out

use dex2jar file to create jar file
d2j-dex2jar.bat D:\MyStuff\Android\odex_deodex\classes.dex
this will generate classes-dex2jar.jar


open the jar file via jd-gui program
jd-gui.exe and choose the jar file classes-dex2jar.jar

 and you can see the code !!!

helpful links
http://madteam.co/forum/tutorials/how-to-deodex-an-odex-file/
http://javakorea.blogspot.co.il/2013/09/odex-decompilation.html
http://forum.xda-developers.com/showthread.php?t=2345435

Monday, February 10, 2014

Multi-touch in Android 2

very good tutorial for image  -  How to use Multi-touch in Android 2 | ZDNet:


here is a sample how to detect clicks
http://stackoverflow.com/questions/11374444/clicklistener-and-longclicklistener-on-the-same-button

nice thread - Multi-touch with multiple buttons is supported at Android 3.0 (google allow multitouch to go the multiple views) .


SDK :
Handling Multi-Touch Gestures

another good tutorial  Handling single and multi touch on Android- Tutorial

sample - Touch handling in Android


enjoy
Yaniv Tzanany