Coderock

--------------------------------
link hover image

Android Graphics Example

Frontpage calendar image September 3, 2012

This example extends Activity, creates a subclass of View and overrides the View.onDraw().

link hover image

Android: How to Determine Screen Resolution Programmatically

Frontpage calendar image September 3, 2012

To determine programmatically  the screen resolution of the device: WindowManager w = getWindowManager(); Display d = w.getDefaultDisplay(); // get default display int width = d.getWidth(); //get screen width int height = d.getHeight(); //get screen height

link hover image

Android: Three different icons for android:icon

Frontpage calendar image August 9, 2012

For android:icon you will need to create three different icons: – low pixel density screens (ldpi) – 36×36 pixels – high pixel density screens(hdpi) – 72×72 pixels – medium pixel density screens (mdpi)  – 48×48 pixels Note: Save the graphic  using the same  filename and add the graphic file as a Drawable resource to your application, in the /res/drawable-mdpi directory or […]

link hover image

Android: How to make a phone call from your application

Frontpage calendar image June 24, 2012

First to enable your application to initiate a phone call, you must set permissions in the manifest file:

link hover image

Android: How to Remove backgrounds, titles or window float

Frontpage calendar image June 24, 2012

< resources> < style name=”MyDlgTheme” parent=”android:Theme.Dialog”> < item name=”android:windowBackground”>@null < item name=”android:windowNoTitle”>true < item name=”android:windowIsFloating”>false < /style> < /resources>

link hover image

Android: How to display background image in text view

Frontpage calendar image June 24, 2012

If you are working with xmls you can add: android:background=”@drawable/myResouce” You can also change it from the code: mTextView.setBackgroundResource(R.drawable.myResouce);

link hover image

android.process.acore has stopped unexpectedly. Please try again. – Force close

Frontpage calendar image June 24, 2012

If you get these error when you try to run your application:

link hover image

Android: Main cannot be resolved or is not a field

Frontpage calendar image June 24, 2012

Make sure you don’t have this in imports: import android.R; but you have: import your.application.packagename.R;