-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hzuapps/master
拉取新代码
- Loading branch information
Showing
103 changed files
with
4,183 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="edu.hzuapps.androidworks"> | ||
|
||
<!-- 使用外部存储的权限 --> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
|
||
<!-- 访问网络的权限 --> | ||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name=".MainActivity" | ||
android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".homeworks.BackActivity" | ||
android:label="@string/title_activity_back"> | ||
</activity> | ||
<activity | ||
android:name=".examples.ViewBasicActivity" | ||
android:label="@string/title_activity_view_basic"> | ||
</activity> | ||
<activity | ||
android:name=".examples.ActivityBasicActivity" | ||
android:label="@string/title_activity_activity_basic"> | ||
</activity> | ||
<activity | ||
android:name=".examples.ActivityBasic2Activity" | ||
android:label="@string/title_activity_activity_basic2"> | ||
</activity> | ||
<activity | ||
android:name=".examples.FragmentDemoActivity" | ||
android:label="@string/title_activity_fragment"> | ||
</activity> | ||
<activity | ||
android:name=".examples.FragmentDemoContentActivity" | ||
android:label="@string/title_activity_fragment_content"> | ||
</activity> | ||
<activity | ||
android:name=".homeworks.net123456.Net123456Activity" | ||
android:label="@string/title_activity_net123456"> | ||
</activity> | ||
<activity | ||
android:name=".homeworks.com123456.Com123456Activity" | ||
android:label="@string/title_activity_com123456"> | ||
</activity> | ||
<activity | ||
android:name=".examples.ServiceDemoActivity" | ||
android:label="@string/title_activity_service_demo"> | ||
</activity> | ||
|
||
<service | ||
android:name=".examples.ServiceDemo" | ||
android:enabled="true" | ||
android:exported="true"> | ||
</service> | ||
<service | ||
android:name=".examples.IntentServiceDemo" | ||
android:exported="false"> | ||
</service> | ||
|
||
<activity | ||
android:name=".examples.BroadcastReceiverActivity" | ||
android:label="@string/title_activity_broadcast_receiver"> | ||
</activity> | ||
|
||
<receiver | ||
android:name=".examples.BroadcastReceiverDemo" | ||
android:enabled="true" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="edu.androidlabs.DETECTION"/> | ||
</intent-filter> | ||
</receiver> | ||
|
||
<activity | ||
android:name=".examples.ContentProviderActivity" | ||
android:label="@string/title_activity_content_provider"> | ||
</activity> | ||
|
||
<provider | ||
android:name=".examples.ContentProviderOfBooks" | ||
android:authorities="edu.hzuapps.androidworks.Library" | ||
android:enabled="true" | ||
android:exported="true"> | ||
</provider> | ||
|
||
<activity | ||
android:name=".examples.LinearLayoutActivity" | ||
android:label="@string/title_activity_linear_layout"> | ||
</activity> | ||
<activity | ||
android:name=".examples.RelativeLayoutActivity" | ||
android:label="@string/title_activity_relative_layout"> | ||
</activity> | ||
<activity | ||
android:name=".examples.FrameLayoutActivity" | ||
android:label="@string/title_activity_frame_layout"> | ||
</activity> | ||
<activity | ||
android:name=".examples.TableLayoutActivity" | ||
android:label="@string/title_activity_table_layout"> | ||
</activity> | ||
<activity | ||
android:name=".examples.AbsoluteLayoutActivity" | ||
android:label="@string/title_activity_absolute_layout"> | ||
</activity> | ||
<activity | ||
android:name=".examples.ListViewActivity" | ||
android:label="@string/title_activity_list_view"> | ||
</activity> | ||
<activity | ||
android:name=".examples.ViewDemoActivity" | ||
android:label="@string/title_activity_view_demo"> | ||
</activity> | ||
<activity | ||
android:name=".examples.GridViewActivity" | ||
android:label="@string/title_activity_grid_view"> | ||
</activity> | ||
<activity | ||
android:name=".examples.GridViewOneActivity" | ||
android:label="@string/title_activity_grid_view_one"> | ||
</activity> | ||
<activity | ||
android:name=".examples.SharedPreferencesActivity" | ||
android:label="@string/title_activity_shared_preferences"> | ||
</activity> | ||
<activity | ||
android:name=".examples.FileStorageActivity" | ||
android:label="@string/title_activity_file_storage"> | ||
</activity> | ||
|
||
<provider | ||
android:name="android.support.v4.content.FileProvider" | ||
android:authorities="edu.hzuapps.androidworks.FILE_PROVIDER" | ||
android:exported="false" | ||
android:grantUriPermissions="true"> | ||
<meta-data | ||
android:name="android.support.FILE_PROVIDER_PATHS" | ||
android:resource="@xml/file_paths"/> | ||
</provider> | ||
|
||
<activity | ||
android:name=".examples.FileSelectActivity" | ||
android:label="@string/title_activity_file_select"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.PICK"/> | ||
|
||
<category android:name="android.intent.category.DEFAULT"/> | ||
<category android:name="android.intent.category.OPENABLE"/> | ||
|
||
<data android:mimeType="text/plain"/> | ||
<data android:mimeType="image/*"/> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".examples.FileShareActivity" | ||
android:label="@string/title_activity_file_share"> | ||
</activity> | ||
<activity | ||
android:name=".examples.NetworkActivity" | ||
android:label="@string/title_activity_network"> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
package edu.hzuapps.androidworks; | ||
|
||
// java.lang.* | ||
|
||
import android.widget.TextView; | ||
|
||
import java.math.BigInteger; | ||
import java.util.Date; | ||
import java.io.File; | ||
import java.util.StringTokenizer; | ||
|
||
import edu.hzuapps.androidworks.demo.StaticMethods; | ||
|
||
import static edu.hzuapps.androidworks.demo.StaticMethods.*; | ||
|
||
/** | ||
* javadoc | ||
* Created by zengsn on 16/3/11. | ||
*/ | ||
public class Clazz { | ||
|
||
protected int i = 0; | ||
private float f = 0.0f; | ||
boolean b = false; | ||
|
||
|
||
String str = "abc def ghi"; | ||
Integer ii = null; | ||
|
||
StringBuffer strBuff = null; | ||
StringBuilder strBui = null; | ||
|
||
|
||
Clazz1 mClazz1 = new Clazz1(); | ||
|
||
int[] arr = new int[10]; | ||
|
||
public Clazz() { | ||
} | ||
|
||
public Clazz(int i) { | ||
this.i = i; | ||
} | ||
|
||
void func() { | ||
|
||
|
||
StringTokenizer strTok = new StringTokenizer(str); | ||
while (strTok.hasMoreTokens()) { | ||
String token = strTok.nextToken(); | ||
} | ||
|
||
int bigInt = 1111111111; | ||
BigInteger bi = new BigInteger("111111111111111111111111111111"); | ||
|
||
Integer iiii = 1; | ||
Float fffff = 0.0f; | ||
Boolean bbbbb = true; | ||
|
||
System.out.print(""); | ||
System.currentTimeMillis(); | ||
|
||
int iii = MAX; | ||
|
||
Date date = new Date(); | ||
|
||
File file = new File(""); | ||
|
||
if (b) { | ||
|
||
} | ||
|
||
for (int j = 0; j < 10; j++) { | ||
|
||
} | ||
|
||
while (b) { | ||
; | ||
} | ||
|
||
Class oneClass = this.getClass(); | ||
|
||
} | ||
|
||
public static void main(String[] args) throws ClassNotFoundException { | ||
int i = 1; | ||
int j = 2; | ||
j = 0; | ||
try { | ||
int k = i / j; | ||
// | ||
// | ||
} catch (RuntimeException e) { | ||
// unchecked exception | ||
throw new MyRuntimeException(); | ||
} | ||
Clazz clazz = new Clazz(); | ||
|
||
Class oneClass = Class.forName("edu.hzuapps.androidworks.Clazz"); | ||
oneClass = Clazz.class; | ||
// Method, Field, Contructor, Package, | ||
try { | ||
Object object = oneClass.newInstance(); | ||
if (object instanceof Clazz) { | ||
|
||
} | ||
clazz = (Clazz) object; // ClassCastException | ||
} catch (InstantiationException e) { | ||
e.printStackTrace(); | ||
} catch (IllegalAccessException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
|
||
Object object1 = clazz; | ||
clazz.func(); | ||
|
||
|
||
try { | ||
Thread.sleep(1000*3); | ||
} catch (InterruptedException e) { | ||
e.printStackTrace(); | ||
} | ||
|
||
Thread current = Thread.currentThread(); | ||
|
||
Thread thread = new Thread(new Runnable() { | ||
@Override | ||
public void run() { | ||
System.out.print(">>>"); | ||
} | ||
}); | ||
thread.run(); | ||
|
||
} | ||
} | ||
|
||
class Clazz1 { | ||
//private int i; | ||
protected int j; | ||
int k; | ||
public int l; | ||
|
||
|
||
void func() { | ||
Clazz clazz = new Clazz(); | ||
} | ||
|
||
public int getI() { | ||
return 0; | ||
} | ||
|
||
public int getJ() { | ||
return j; | ||
} | ||
|
||
public int getK() { | ||
return k; | ||
} | ||
|
||
public int getL() { | ||
return l; | ||
} | ||
|
||
public void setJ(int j) { | ||
this.j = j; | ||
} | ||
|
||
public void setK(int k) { | ||
this.k = k; | ||
} | ||
|
||
public void setL(int l) { | ||
this.l = l; | ||
} | ||
} | ||
|
||
class Clazz2 { | ||
|
||
void func() throws MyException { | ||
//this.j = 1; | ||
throw new MyException(); | ||
} | ||
} | ||
|
||
class Clazz3 { | ||
|
||
void func() throws MyRuntimeException { | ||
//this.j = 1; | ||
throw new MyRuntimeException(); | ||
} | ||
} | ||
|
||
class MyException extends Exception { | ||
} | ||
|
||
class MyRuntimeException extends RuntimeException { | ||
} | ||
|
Oops, something went wrong.