Skip to main content

Posts

Showing posts from February, 2013

Android – Bullets in ListView

main.xml : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="10dp"> <ListView android:id="@+id/listView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:listSelector="@android:color/transparent" android:divider="@null"/> </LinearLayout> create a bullet.xml in drawable folder: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <size android:height="6dp" android:width="6dp"/> ...

How to write interfaces in java or Android?

what is an Interface? An interface is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface. An interface is not a class. Writing an interface is similar to writing a class, but they are two different concepts. A class describes the attributes and behaviors of an object. An interface contains behaviors that a class implements. Unless the class that implements the interface is abstract, all the methods of the interface need to be defined in the class. MainActivity.java public class MainActivity extends Activity implements Interface { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public void testFunctionOne() { System.out.println("Print from testFunctionOne in the Interface"); } @Override public void testFunctionTwo() { Syst...

Using DialogFragments in Android

MainActivity.java : public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); FragmentManager fm = getSupportFragmentManager(); dialogfragment testDialog = new dialogfragment(); testDialog.setRetainInstance(true); testDialog.show(fm, "fragment_name"); }} Dialogfragment.java : public class Dialogfragment extends DialogFragment { public void TestDialog() { // Empty constructor required for DialogFragment } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) { View view = inflater.inflate(R.layout.dialog, container); return view; } } dialog.xml : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/edit_name" ...

Fragmentation In Android

See more basics on Android along with interview questions Fragments are a portion of an Activity: Load a fragment Activity to call a fragment : public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } } activity_main : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <fragment android:id="@+id/titles" android:layout_width="0px" android:layout_height="match_parent" android:layout_weight="1" class="com.example.googlefragment.TitlesFragment"/> //calls the fragment </LinearLayout> TitlesFragment : ...

LG Optimus G makes its way to the land down under March 13

LG is rolling out its flagship Optimus G to more countries, and that rollout is set to hit Australia on March 13th. The Optimus G has been available here in the states (and a couple other countries) since October, but LG has just recently announced that the device will make its way to other countries in the coming months. Australians hoping to pick up an Optimus G will be stuck with just one carrier, Telstra, and no pricing has been released just yet. Based on what has LG stated before, this device will have LTE on board and should also ship out of the box with Jelly Bean, which is a nice consolation prize considering how late it's arriving. Read More: http://www.androidcentral.com/

Android 4.1.2 Jelly Bean now rolling out to Motorola RAZR i smartphones in the UK

Motorola RAZR i handsets have begun receiving the highly anticipated update to Android 4.1.2 Jelly Bean today. The new firmware brings the usual slew of new features including expandable notifications,  Google Now , Project Butter and Face Unlock. Read More: http://www.talkandroid.com/150026-android-4-1-2-jelly-bean-now-rolling-out-to-motorola-razr-i-smartphones-in-the-uk/#more-150026

Average North American user could consume 6GB of mobile data per month by 2017

According to research and predictions by Cisco , the average North American smartphone user could consume 6GB of data per month by 2017. The annual report, which has been released six times now, shows smartphone data usage increasing 13-fold worldwide in the next four years. The average North American user currently consumes 752MB per month as of 2012, and the worldwide average is just 200MB. In just four short years those numbers are expected to hit 6GB and 2GB, respectively. These numbers are even slightly more conservative than previous years and estimates from other entities. Read More: http://www.androidcentral.com/