This file contains hidden or 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
| package com.example; | |
| import java.io.IOException; | |
| import java.io.UnsupportedEncodingException; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import org.apache.http.HttpEntity; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.NameValuePair; |
This file contains hidden or 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
| package com.example; | |
| import java.io.FileNotFoundException; | |
| import java.io.IOException; | |
| import java.io.RandomAccessFile; | |
| public class IndexGen { | |
| private static final byte CR = 0x0D; | |
| private static final byte LF = 0x0A; |
This file contains hidden or 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
| // Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov Date: 2010-8-24 22:45:44 | |
| // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version! | |
| // Decompiler options: packimports(3) | |
| // Source File Name: ClockWidget.java | |
| package com.sonyericsson.android.digitalclock; | |
| import android.app.Service; | |
| import android.appwidget.AppWidgetManager; | |
| import android.content.BroadcastReceiver; |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:layout_width="fill_parent" | |
| android:layout_height="fill_parent" | |
| android:fillViewport="true"> | |
| <LinearLayout android:layout_width="fill_parent" | |
| android:layout_height="fill_parent" | |
| android:orientation="vertical"> | |
| <!-- |
This file contains hidden or 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 LyricView extends View { | |
| private Lyric mLyric; | |
| private Sentence mSentence; | |
| public void update(long time) { | |
| mSentence = mLyric.getSentence(time); | |
| invalidate(); | |
| } | |
| @Override |
This file contains hidden or 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
| <weatherdata> | |
| <weather weatherlocationcode="wc:CHXX0008" weatherlocationname="Beijing, CHN" zipcode="" encodedlocationname="Beijing%2c+CHN" url="http://weather.msn.com/local.aspx?wealocations=wc:CHXX0008&q=Beijing%2c+CHN" imagerelativeurl="http://blst.msn.com/as/wea3/i/en-us/" degreetype="C" provider="Foreca" attribution="Data provided by Foreca" attribution2="© Foreca" lat="39.9125748" long="116.3889847" timezone="8" alert=""> | |
| <current temperature="22" skycode="28" skytext="Mostly Cloudy" date="2010-06-11" day="Friday" shortday="Fri" observationtime="09:30:00" observationpoint="Tianjin / Zhangguizhu" feelslike="22" humidity="69" windspeed="11" winddisplay="11 km/hr SSE"/> | |
| <forecast low="19" high="27" skycodeday="26" skytextday="Cloudy" date="2010-06-11" day="Friday" shortday="Fri" precip="35"/> | |
| <forecast low="20" high="31" skycodeday="28" skytextday="PM Clouds" date="2010-06-12" day="Saturday" shortday="Sat" precip="10"/> | |
| <forecast low="20" high="31" skycodeday="26" skytextday="Cloudy" date="201 |
This file contains hidden or 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
| private void parseWeather() { | |
| mForecasts = new ArrayList<Map<String,String>>(); | |
| mCondition = new HashMap<String, String>(); | |
| InputStream is = null; | |
| try { | |
| // is = getLocalWeatherSource(); | |
| is = getWebWeatherSource(); | |
| XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:orientation="vertical" android:layout_height="wrap_content" | |
| android:layout_width="fill_parent"> | |
| <TextView android:id="@+id/TextView01" android:layout_height="wrap_content" | |
| android:layout_width="wrap_content" android:text="This text view should act as header " /> | |
| <ScrollView android:layout_marginBottom="50dip" android:id="@+id/ScrollView01" | |
| android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1.0"> | |
| <RadioGroup android:id="@+id/RadioGroup01" | |
| android:layout_width="wrap_content" android:layout_height="wrap_content"> |
This file contains hidden or 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 Test { | |
| public static void main(String[] args) { | |
| int a = 165, b = 55; | |
| System.out.printf("%d 和 %d 的最大公约数是: %d\n", a, b, gcd(a, b)); | |
| } | |
| public static int gcd(int a, int b) { | |
| // suppose a > b; | |
| int r = a % b; | |
| while (r != 0) { |
This file contains hidden or 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 Test { | |
| public static void main(String[] args) { | |
| int number = 37; | |
| if(isPrime(number)) | |
| System.out.println(number + " is a prime number"); | |
| else | |
| System.out.println(number + " is not a prime number"); | |
| } | |
| public static boolean isPrime(int number) { |