skip to main | skip to sidebar

Thursday, January 19, 2012

App for Android 3.0 With Dual Fragment

0 comments
Dual Fragment App

Create layout and class of Fragment1:
/res/layout/fragment1.xml
<<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/darker_gray">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment 1"
android:textColor="@android:color/white"/>

</LinearLayout>


Fragment1.java
package com.exercise.AndroidDualFragment;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class Fragment1 extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.fragment1, container, false);
}

}


Create layout and class of Fragment2:
/res/layout/fragment2.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/background_light">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Fragment 2"
android:textColor="@android:color/black"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/ic_launcher" />
</LinearLayout>


Fragment2.java
package com.exercise.AndroidDualFragment;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class Fragment2 extends Fragment {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
return inflater.inflate(R.layout.fragment2, container, false);
}

}


Modify main.xml to have two Fragment:
<?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="horizontal" >

<fragment
android:name="com.exercise.AndroidDualFragment.Fragment1"
android:id="@+id/fragment1"
android:layout_weight="1"
android:layout_width="0px"
android:layout_height="match_parent" />
<fragment
android:name="com.exercise.AndroidDualFragment.Fragment2"
android:id="@+id/fragment2"
android:layout_weight="2"
android:layout_width="0px"
android:layout_height="match_parent" />

</LinearLayout>



Keep no change on the auto generated main activity, AndroidDualFragmentActivity.java.
package com.exercise.AndroidDualFragment;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class AndroidDualFragmentActivity extends Activity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}


}


Related Article:
- Apply different layout on different orientation, portrait and landscape.

Wednesday, December 7, 2011

TTPOD 2.8.1 Apk music player Download

0 comments
Application of the latest release TTPOD 2.8.1 Apk music player is a music player for mobile devices developed by several teams are reliable. You can use this application with your android phone

latest update has come out: the new version 2.8.1
support Android Support: Android 1.5 cupcake, android 1.6 donut, android 2.0 / 2.1 eclair, froyo android 2.2, android 2.3 ginger, android tablets 3 honeycomb ice cream sandwich android 4 or above
2.8.1 ttpod Apk music player for Android

TTPOD 2.8.1 Apk music player v2.8.1 update:
1. some models can not be used to play WMA files;
2. some of solving problems caused by problems flac ID3 format can not be played;
3. solve some of the models click on the thumbnail issue out into the desktop interface;
4. out of solution can not remember the song played after the issue.

TTPOD 2.8.1 Apk music player New Features:
1. The new EQ setting function
2. New search features local song
3. new songs built-in switch display images (default on)
4. New aac, M4a format decoding
5. "Skinnable" dialog box, add "more" button, click on the download channel to jump every day is recommended skin
this application is not freely available, please visit the Android Market intuk get it
Ttpod music player 2.8.1 Final Apk 3.1 MB

Thursday, November 3, 2011

Android : Horizontal SlidingDrawer

0 comments
Android : Horizontal SlidingDrawer - Android : Horizontal SlidingDrawer  - Android : Horizontal SlidingDrawer - Android : Horizontal SlidingDrawer.

Android : Capture video using flash light MediaRecorder

0 comments

During video recording MediaRecorder, we can control the flash light built through Camera.setParameters ().

Wednesday, November 2, 2011

Complete SDK for Android 3.0 now available

0 comments
The full SDK for Android 3.0 is now available for developers. The APIs are final, and now you can develop applications targeting this new platform and publish on Android Market. The new API level is 11.

For an overview of the new features of users and developers, see the highlights of Android 3.0 platform.

Along with the new platform, the SDK tools (r10) and ADT plugin for Eclipse (10.0.0) have been updated as well.

Necessitas: Qt port on Android

0 comments
Necessitas is the codename for the Qt port of the Android operating system integration and easy to use Qt Creator with Android

This project offers Qt for Android operating system, and a first class citizen IDE that lets you manage, develop, implement, run and debug Qt on Android devices.

Solution Android SDK Cannot Detect JDK

0 comments
Normally I develop Android on Linux machine, and just tried to install the new version of Android SDK on my Windows 7 machine today. I downloaded the exe version of the Android SDK, installer_r10-windows.exe. And run it, it's complained by the Android SDK Tools Setup Java SE Development Kit That not found. No matter how I config my Windows 7 and JDK!