Showing posts from September, 2012

AMD CodeXL: OpenGL and OpenCL Debugger and Profiler

AMD CodeXL is a new tool for OpenGL and OpenCL developers. CodeXL includes a GPU debugger, a profiler for both GPU and CPU and offers OpenCL kernels analysis capabilities. CodeXL is available as a standalone application for Linux (64-bit) and Windows (32 and 64-bit). An extension for Visual Studio is also available.

Android customized button

drawable/ return_btn.xml values/ style.xml

Create drawable/return_btn.xml in drawable folder
Create values/style.xml in your value folder Add ReturnButton style in your layout



private static final String DB_PATH = "/data/data/"; private static final String DB_NAME = "xxx.sqlite"; SQLiteDatabase database = this.getReadableDatabase(); try { //Open your local db as the input stream InputStream myInput = ctx.getAssets().open(DB_NAME); // Path to the just created empty db String outFileName = DB_PATH + DB_NAME; //Open the empty db as the output stream OutputStream myOutput = new FileOutputStream(outFileName); //transfer bytes from the inputfile to the outputfile byte[] buffer = new byte[1024]; int length; while ((length =>0){ myOutput.write(buffer, 0, length); } //Close the streams myOutput.flush(); myOutput.close(); myInput.close(); } catch (IOException e) { throw new Error("Error copying database"); } …

Chat List show/hide keyboard

_chatList.setOnTouchListener( new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // TODO Auto-generated method stub ( //close keyboard (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow( _chatText.getWindowToken(), 0); //open keyboard ((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(chatText, InputMethodManager.SHOW_FORCED); return false; } });