EF's Blog

Posts Tagged ‘dev

Bitmap bmp = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory()
+ strStoragePath+strLocalFileName+strJPGext);
ivThumbnailPlaceHolder.setImageBitmap(bmp);

That is the code.

This “Environment.getExternalStorageDirectory()+ strStoragePath+strLocalFileName+strJPGext” actually meant the file path, for example : “mnt/sdcard/yourfolder/blabla.jpg”.

 

final String TAG = “MyActivity”;
Log.v(TAG, “Index=” + intNumber);

Log.v

Screenshot of use of log v command

public static int getMetricDPI(Activity myActivityReference)
{

//created by Erwin Fransiscus
//get display DPI
DisplayMetrics metrics = new DisplayMetrics();
myActivityReference.getWindowManager().getDefaultDisplay().getMetrics(metrics);
return metrics.densityDpi;
}

 

it returns integer

I’ve tried several tutorial to create splash screen and most of them does not work.

And somehow i found this indonesian link website and it is work.

http://pratamawijaya.com/programming/programming-membuat-splash-screen-pada-android

so if someone need a working one, you can visit the link.

and this is the  english google-translated link for the website above : http://translate.googleusercontent.com/translate_c?hl=en&rurl=translate.google.com&sl=id&tl=en&twu=1&u=http://pratamawijaya.com/programming/programming-membuat-splash-screen-pada-android&usg=ALkJrhgvoM_ev8pdNZt8ZHcPbcKLH7T8JQ

you can add this

//remove title bar
this.requestWindowFeature(Window.FEATURE_NO_TITLE);

super.onCreate(savedInstanceState);
setContentView(R.layout.main);

make sure the line is before layout declaration or your app will crash

create new class

public class basicdisplayoption {
public static void toggleStatusBar(Activity myActivityReference, boolean boolYesNo) {
if(boolYesNo == true)
{
WindowManager.LayoutParams attrs = myActivityReference.getWindow().getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
myActivityReference.getWindow().setAttributes(attrs);
}
else
{
WindowManager.LayoutParams attrs = myActivityReference.getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
myActivityReference.getWindow().setAttributes(attrs);
}
}
}

and
at activity onCreate, to turn on status bar, call
basicdisplayoption.toggleStatusBar(sinarmasmsiglife.this, true);
to turn off :
basicdisplayoption.toggleStatusBar(sinarmasmsiglife.this, false);


EF’s Blog

I'm just ordinary people who lived in an extra-ordinary world.

EF's Blog Stats

  • 153,670 hits
May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Archives