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”.

 

Advertisements

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

  • 138,553 hits
October 2017
M T W T F S S
« Jul    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Archives