Skip to content

Instantly share code, notes, and snippets.

@CharlotteJhao
CharlotteJhao / Android_WebView Manifest.xml
Last active December 21, 2015 17:08
The example is how to view a website page on the phone app.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.AndroidWebView"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET" />
@CharlotteJhao
CharlotteJhao / eclipse.ini
Created August 26, 2013 02:48
eclipse.ini setting
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jre7\bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
@CharlotteJhao
CharlotteJhao / javascriptchgselect.html
Last active December 21, 2015 08:38
javascript onchange
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>show demo</title>
</head>
<body>
<!--choose these options to change text color-->
<select onChange="funName(this.value);">
<option value="red">Red</option>
<option value="green">Green</option>
@CharlotteJhao
CharlotteJhao / jqueryautoadddelblock.html
Last active December 21, 2015 06:49
add new block and remove block dynamically
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>show demo</title>
</head>
<body>
<!-- add new item Dynamically in the show block -->
<div id="showBlock"></div>
<!-- click the button to add new item -->
<input type="button" id="btn" value="addItem" />
@CharlotteJhao
CharlotteJhao / jqueryaddoutblock.html
Last active December 21, 2015 01:39
jQuery modify the block content. 1. append 2.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>show demo</title>
</head>
<body>
<!-- add new item Dynamically in the show block -->
<div id="showBlock">
Input:<input type="text" name="test[]" />
</div>
@CharlotteJhao
CharlotteJhao / jquerydisplay_1.js
Last active December 21, 2015 00:19
Jquery block's display switch
//normal type
$("#clickId").click(function () {
$("#showId").show();
});
public class NetworkCheck extends BroadcastReceiver{
private static final String TAG = "NetworkCheck";
private static final int MAX_ATTEMPTS = 5;
private static final int BACKOFF_MILLI_SECONDS = 100;
private static boolean networkConnectStatus = false;
public void onReceive(Context context, Intent intent) {
networkConnectStatus = checkInternetConnection(context);
}
@CharlotteJhao
CharlotteJhao / MainActivity.java
Last active December 16, 2015 13:29
Android check network connect
package com.test;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView txtResult;
@Override
package com.test;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
public class MainActivity extends Activity {