November 23, 2010

[SOLVED] helloWorldPlugin example from LiveView SDK 1.0 does't work

No example from LiveView™ SDK 1.0 work (helloWorldPlugin).

Getting something like (mPluginId=0):
D/LiveViewPlugin(15550): Plugin registered. mPluginId: 0 isSandbox? true
D/LiveViewPlugin(15550): Plugin installation notified.
D/LiveViewPlugin(15550): Registry success!

Just add in your manifest.xml
<uses-permission android:name="com.sonyericsson.extras.liveview.permission.LIVEVIEW_API"/>

Noow works everything perfect - you got your mPluginId and can play ;)
D/LiveViewPlugin(15843): Plugin installation notified.
D/LiveViewPlugin(15843): Registry success!D/LiveViewPlugin(15843): Plugin registered. mPluginId: 161427209 isSandbox? true
D/LiveViewKupriyanovPlugin(15481): startPluginD/LiveViewKupriyanovPlugin(15481): Enter HelloWorldService.startWork.

Source: http://russenreaktor.wordpress.com/2010/11/23/solved-helloworldplugin-example-from-liveview-sdk-1-0-doest-work/

November 21, 2010

[SOLVED] How can i call Wi-Fi settings screen from my App

To start wifi settings dialog:
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

to start Settings Dialog
startActivity(new Intent(Settings.ACTION_SETTINGS));

to start any settings dialog read the reference

Source: stackoverflow.com

Reference: http://developer.android.com/reference/android/provider/Settings.html

[SOLVED] How to create Alert Dialog?

AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure you want to exit?")
       .setCancelable(false)
       .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id) {
                MyActivity.this.finish();
           }
       })
       .setNegativeButton("No", new DialogInterface.OnClickListener() {
           public void onClick(DialogInterface dialog, int id) {
                dialog.cancel();
           }
       });
AlertDialog alert = builder.create();
alert.show();

Source: developer.android.com

[SOLVED] How to check internet access on Android?

You can use
Context.getSystemService(Context.CONNECTIVITY_SERVICE).getNetworkInfo(ConnectivityManager.TYPE_MOBILE)

or
Context.getSystemService(Context.CONNECTIVITY_SERVICE).getNetworkInfo(ConnectivityManager.TYPE_WIFI)

and parse the DetailedState enum of the returned NetworkInfo object

 

and don't forget to allow it the Manifest

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 

Source: stackoverflow.com

Documentation: http://developer.android.com/reference/android/net/ConnectivityManager.html

November 20, 2010

[SOLVED] Android: When the soft keyboard pops up, the EditText is invisible

Just add android:windowSoftInputMode="adjustPan" for your activity in manifest file
<activity android:name="SampleActivity" android:label="@string/app_name" android:windowSoftInputMode="adjustPan" >
...
</activity>

Source: stackoverflow.com

Documentation: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
Tutorial: http://android-developers.blogspot.com/2009/04/updating-applications-for-on-screen.html

November 16, 2010

[SOLVED] Android - Arrange two buttons next to each other and to center them horizontally.

Arrange two buttons next to each other and to center them horizontally.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="horizontal"
    android:background="@android:drawable/bottom_bar" android:paddingLeft="4.0dip"
    android:paddingTop="5.0dip" android:paddingRight="4.0dip"
    android:paddingBottom="1.0dip" android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:layout_below="@+id/TextView01">
    <Button android:id="@+id/allow" android:layout_width="0.0dip"
        android:layout_height="fill_parent" android:text="Allow"
        android:layout_weight="1.0" />
    <Button android:id="@+id/deny" android:layout_width="0.0dip"
        android:layout_height="fill_parent" android:text="Deny"
        android:layout_weight="1.0" />
</LinearLayout>

 

Source: stackoverflow.com

November 15, 2010

November 14, 2010

GTUG Bootcamp 2010 in Munich

Here yo will get small overview of  "GTUG Bootcamp 2010 in Munich". You can also go directly to picasa gallery to comment pictures there ;) http://picasaweb.google.com/m.kupriyanov/GTUGBootcamp2010InMunich

Stuttgart GTUG [@StuGTUG] goes GTUG BootCamp in Munich #gtugbc