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
| function makeList(ref) { | |
| var fruits = ["banana", "apple", "grape", "orange"]; | |
| for (var i = 0; i < fruits.length; i++) { | |
| ref.push(fruits[i]); | |
| } | |
| } | |
| function getFirstFromList(ref, cb) { | |
| ref.startAt().limit(1).once("child_added", function(snapshot) { | |
| cb(snapshot.val()); |
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
| /* | |
| This example shows how you can use your data structure as a basis for | |
| your Firebase security rules to implement role-based security. We store | |
| each user by their Twitter uid, and use the following simplistic approach | |
| for user roles: | |
| 0 - GUEST | |
| 10 - USER | |
| 20 - MODERATOR |
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
| /*************************************************** | |
| * Assuming you can't use priorities (e.g. they are already being used for something else) | |
| * You can store the email addresses in an index and use that to match them to user ids | |
| ***************************************************/ | |
| var fb = new Firebase(URL); | |
| /** | |
| * Looks up a user id by email address and invokes callback with the id or null if not found | |
| * @return {Object|null} the object contains the key/value hash for one user |
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
| function go() { | |
| var userId = prompt('Username?', 'Guest'); | |
| checkIfUserExists(userId); | |
| } | |
| var USERS_LOCATION = 'https://SampleChat.wilddogio.com/users'; | |
| function userExistsCallback(userId, exists) { | |
| if (exists) { | |
| alert('user ' + userId + ' exists!'); |
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"?> | |
| <manifest | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| android:versionCode="49466" | |
| android:versionName="2.0.3-release" | |
| android:installLocation="0" | |
| package="com.facebook.orca" | |
| > | |
| <uses-sdk | |
| android:minSdkVersion="8" |
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.facebook.analytics; | |
| import android.app.ActivityManager; | |
| import android.app.ActivityManager.MemoryInfo; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.IntentFilter; | |
| import android.content.SharedPreferences; | |
| import android.content.pm.PackageManager; | |
| import android.content.res.Configuration; |
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 jp.naver.android.npush.register; | |
| import android.app.AlarmManager; | |
| import android.app.PendingIntent; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import jp.naver.android.npush.common.Logger; | |
| import jp.naver.android.npush.common.NPushIntent; | |
| public class NPushMessaging |
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.tencent.mm.modelstat; | |
| import android.content.BroadcastReceiver; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import com.tencent.mm.sdk.platformtools.l; | |
| import com.tencent.mm.sdk.platformtools.q; | |
| import com.tencent.mm.t.a.i; | |
| import com.tencent.mm.t.au; |
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 static Bitmap screenshot(Context paramContext) | |
| { | |
| boolean bool = sLoadSO; | |
| Bitmap localBitmap = null; | |
| if (bool); | |
| try | |
| { | |
| byte[] arrayOfByte = getFrameBuffer(); | |
| localBitmap = null; | |
| if (arrayOfByte == null) |
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
| ConnectivityManager connectivity = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); | |
| if (connectivity != null) { | |
| // 获取网络连接管理的对象 | |
| NetworkInfo info = connectivity.getActiveNetworkInfo(); | |
| if (info != null && info.isConnected()) { | |
| // 判断当前网络是否已经连接 | |
| if (info.getState() == NetworkInfo.State.CONNECTED) { | |
| if(info.getTypeName().equals("WIFI")){ | |