Skip to content

Instantly share code, notes, and snippets.

@Tikitoo
Tikitoo / ThisTest.java
Created July 25, 2014 07:12
This 的用法
package com.tikitoo.java.base;
/**
* Created by Tikitoo1 on 2014/7/25.
*/
public class ThisTest {
String name;
int age;
String sex;
@Tikitoo
Tikitoo / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Tikitoo
Tikitoo / AndroidManifest.xml
Created November 25, 2014 03:48
Android Read JSON Data.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.JSONDemo3"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="16"/>
<application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
<activity android:name="MyActivity"
android:label="@string/app_name">
<intent-filter>
[
{
"name": "tikitoo",
"age": "23"
},
{
"name": "zhangsan",
"age": "33"
},
{
{
login: "Tikitoo",
id: 6140819,
avatar_url: "https://avatars.githubusercontent.com/u/6140819?v=3",
gravatar_id: "",
url: "https://api.github.com/users/Tikitoo",
html_url: "https://github.com/Tikitoo",
followers_url: "https://api.github.com/users/Tikitoo/followers",
following_url: "https://api.github.com/users/Tikitoo/following{/other_user}",
gists_url: "https://api.github.com/users/Tikitoo/gists{/gist_id}",
package com.tikitoo.demo.app2;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* 参考:
* http://javahowto.blogspot.com/2006/06/4-ways-to-traverse-map.html
* Created by tikitoo on 1/6/15.
@Tikitoo
Tikitoo / ChatClient.java
Created February 6, 2015 12:04
A simple socket chat demo
package socket;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
@Tikitoo
Tikitoo / NotifDemo.java
Created February 12, 2015 06:22
Create a Notification demo
public void onCreate() {
super.onCreate();
Log.d(TAG, "onCreate Method");
// 创建Notification 对象
Notification notif = new Notification(R.drawable.abc_ic_menu_cut_mtrl_alpha,
"This is Notification", System.currentTimeMillis());
// 点击Notification 进入MainActivity
Intent notifIntent = new Intent(this, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
notifIntent, 0);
@Tikitoo
Tikitoo / AndroidManifest.xml
Last active October 31, 2018 06:11
Android check network available
<manifest>
<!-- other code -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
@Tikitoo
Tikitoo / MyActivity.java
Created July 3, 2015 10:00
Android http request response.
package com.tikitoo.android.http.activity;
// ... import
public class MyActivity extends Activity {
private Button httpBtn;
@Override
public void onCreate(Bundle savedInstanceState) {