This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Rest_Tab extends Rest_HeaderFooter { | |
TabHost tabHost; | |
LocalActivityManager mLocalActivityManager; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
//setContentView(R.layout.rest_tab); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Main Activity | |
public class TryGallaryActivity extends Activity { | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Integer[] images = { R.drawable.img0001, R.drawable.img0030, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* main.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/viewpager" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:background="@drawable/background" > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestMatrix | |
{ | |
public static void test(SomeActivity a) | |
{ | |
test1(a); | |
test2(a); | |
test3(a); | |
} | |
public static void test1(SomeActivity a) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Connection; | |
import java.sql.DriverManager; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
public class JDBCGetAutoIncKeys { | |
private static final String DBURL = | |
"jdbc:mysql://localhost:3306/mydb?user=usr&password=sql" + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedInputStream; | |
import java.io.BufferedOutputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
public class TestStringDate { | |
public static void main(String[] args) throws ParseException { | |
String strValue = "2015-07-05 19:52:00"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FindSqrt { | |
public static int sqrt(int no) { | |
int result = 0; | |
int low = 0, high = (no / 2), mid = 0; | |
int midVal = 0; | |
while (low <= high) { | |
mid = (low + high) / 2; | |
System.out.println("Mid Point :" + mid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class LongestConsecutiveSequenceFinder { | |
public static void main(String[] arg) { | |
int[] nums = { 100, 3, 200, 1, 2, 4 }; |
NewerOlder