当前位置: 首页>>代码示例>>Java>>正文


Java BuildConfig.DEBUG属性代码示例

本文整理汇总了Java中android.support.v4.BuildConfig.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java BuildConfig.DEBUG属性的具体用法?Java BuildConfig.DEBUG怎么用?Java BuildConfig.DEBUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.support.v4.BuildConfig的用法示例。


在下文中一共展示了BuildConfig.DEBUG属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sendBroadcast

private void sendBroadcast(@NonNull Context context,
                           @Nullable String messageFrom,
                           @Nullable String smsMessage) {
    Intent broadcastIntent = new Intent(INTENT_ACTION_SMS);

    String smsCode = null;
    if (smsMessage != null) {
        try {
            smsCode = getSmsCode(smsMessage);
        } catch (StringIndexOutOfBoundsException e) {
            if (BuildConfig.DEBUG) {
                Log.d(SmsReceiver.class.getName(), e.getMessage());
            }
        }
    }

    broadcastIntent.putExtra(KEY_SMS_SENDER, messageFrom);
    broadcastIntent.putExtra(KEY_SMS_MESSAGE, smsCode);
    LocalBroadcastManager.getInstance(context).sendBroadcast(broadcastIntent);
}
 
开发者ID:adorsys,项目名称:sms-parser-android,代码行数:20,代码来源:SmsReceiver.java

示例2: removeDoc

/**
 * Handles deleting a document in a collection.
 * Override if you want to use your own collection data store.
 * @param collName collection name
 * @param docId document ID
 * @return true if doc was deleted, false otherwise
 */
public boolean removeDoc(String collName, String docId) {
    if (mCollections.containsKey(collName)) {
        // remove IDs from collection
        Map<String, Map<String,Object>> collection = mCollections.get(collName);
        if (BuildConfig.DEBUG) {
            log.debug("Removed doc: " + docId);
        }
        collection.remove(docId);
        return true;
    } else {
        log.warn("Received invalid removed msg for collection "
                + collName);
        return false;
    }
}
 
开发者ID:kenyee,项目名称:android-ddp-client,代码行数:22,代码来源:DDPStateSingleton.java

示例3: addDoc

/**
 * Handles adding a document to collection.
 * Override if you want to use your own collection data store.
 * @param jsonFields fields for document
 * @param collName collection name
 * @param docId document ID
 */
@SuppressWarnings("unchecked")
public void addDoc(Map<String, Object> jsonFields, String collName,
        String docId) {
    if (!mCollections.containsKey(collName)) {
        // add new collection
        log.debug("Added collection " + collName);
        mCollections.put(collName, new ConcurrentHashMap<String, Map<String,Object>>());
    }
    Map<String, Map<String,Object>> collection = mCollections.get(collName);

    Map<String, Object> fields;

    if(jsonFields.get(DdpMessageField.FIELDS) == null) {
        fields = new ConcurrentHashMap<>();
    } else {
        fields = (Map<String, Object>) jsonFields.get(DdpMessageField.FIELDS);
    }

    collection.put(docId, fields);

    if (BuildConfig.DEBUG) {
        log.debug("Added docid " + docId + " to collection " + collName);
    }
}
 
开发者ID:kenyee,项目名称:android-ddp-client,代码行数:31,代码来源:DDPStateSingleton.java

示例4: onCreate

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // active StrictMode when debug
    if (BuildConfig.DEBUG) {
        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
    }

    if (this.getNavigationItemSelectedListener() != null) {
        this.mNavigationView.setNavigationItemSelectedListener(this.getNavigationItemSelectedListener());
    }

    this.mDrawerLayout.addDrawerListener(new BaseDrawerListener());

    this.mMenuItems = new ArrayMap<>();
    int[] menuItemIds = this.getMenuItemIds();

    if (menuItemIds.length > 0) {
        for (int id : menuItemIds) {
            MenuItem menuItem = this.mNavigationView.getMenu().findItem(id);
            if (menuItem != null)
                this.mMenuItems.put(id, menuItem);
        }
    }

    this.mDrawerToggle = new ActionBarDrawerToggle(this,
            this.mDrawerLayout,
            R.string.navigation_drawer_open,
            R.string.navigation_drawer_close);

    View v = mNavigationView.getHeaderView(0);
    mNickname = (TextView) v.findViewById(R.id.tv_name);
    mSignature = (TextView) v.findViewById(R.id.tv_sign);
}
 
开发者ID:yansha87,项目名称:douban-movie,代码行数:36,代码来源:BaseDrawerLayoutActivity.java

示例5: getUUID

/**
 * 获取全局UUID
 *
 * @param context 上下文容器
 * @return UUID
 */
public static String getUUID(Context context) {
    String uuid = null;
    SharedPreferences preferences =
            PreferenceManager.getDefaultSharedPreferences(context);
    if (preferences != null)
        uuid = preferences.getString("uuid", "");
    if (TextUtils.isEmpty(uuid)) {
        uuid = UUID.randomUUID().toString();
        if (preferences != null)
            preferences.edit().putString("uuid", uuid).commit();
    }
    if (BuildConfig.DEBUG) Log.d(TAG, "getUUID : " + uuid);  //DEBUG
    return uuid;
}
 
开发者ID:LimeVista,项目名称:EasyUtils,代码行数:20,代码来源:DevicesInfoUtils.java

示例6: onCreate

@Override
public void onCreate(final SQLiteDatabase db) {
    db.execSQL(CREATE);
    try {
        addOrigin(db, new HttpOrigin("localhost", 80), "Manager (HTTP)", System.currentTimeMillis());
    } catch (OriginDBException e) {
        if (BuildConfig.DEBUG) {
            Log.e("Origin", "error.");
        }
    }
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:11,代码来源:Whitelist.java

示例7: onManagerEventTransmitDisconnected

@Override
protected void onManagerEventTransmitDisconnected(final String origin) {
    if (BuildConfig.DEBUG) {
        mLogger.info("Plug-in : onManagerEventTransmitDisconnected");
    }
    if (origin != null) {
        EventManager.INSTANCE.removeEvents(origin);
    } else {
        EventManager.INSTANCE.removeAll();
    }
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:11,代码来源:HostDeviceService.java

示例8: onDevicePluginReset

@Override
protected void onDevicePluginReset() {
    if (BuildConfig.DEBUG) {
        mLogger.info("Plug-in : onDevicePluginReset");
    }
    resetPluginResource();
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:7,代码来源:HostDeviceService.java

示例9: onCreate

@Override
public void onCreate() {
    super.onCreate();

    BlueteethManager.getInstance().initialize(this);


    if (BuildConfig.DEBUG) {
        Timber.plant(new DebugTree());
    } else {
        Timber.plant(new CrashReportingTree());
    }
}
 
开发者ID:RobotPajamas,项目名称:bgscript-debugger-android,代码行数:13,代码来源:MainApplication.java

示例10: v

public static void v(final String tag, String message) {
    // include logging only in debug versions
    if (BuildConfig.DEBUG || mTesting) {
        Log.v(tag, message);
    }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:6,代码来源:LogHelper.java

示例11: onUpgrade

@Override
public final void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    if (oldVersion < LAST_DATABASE_NUKE_VERSION) {
        if (BuildConfig.DEBUG) {
            Timber.d(TAG + " Nuking Database. Old Version: " + oldVersion);
        }
        cupboard().withDatabase(db).dropAllTables();
        onCreate(db);
    } else {
        // This will upgrade tables, adding columns and new tables.
        // Note that existing columns will not be converted
        cupboard().withDatabase(db).upgradeTables();
    }
}
 
开发者ID:eyedol,项目名称:birudo,代码行数:14,代码来源:BaseDatabseHelper.java

示例12: setVersionName

private void setVersionName() {
    try {
        PackageInfo pInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0);
        String versionNameText = pInfo.versionName;
        if (BuildConfig.DEBUG) {
            versionNameText += ".dev";
        }
        mVersionName.setText(getString(R.string.dialog_about_version, versionNameText));
    } catch (PackageManager.NameNotFoundException e) {
        mVersionName.setText(getString(R.string.dialog_about_unknown_version));
    }
}
 
开发者ID:tvbarthel,项目名称:SayItFromTheSky,代码行数:12,代码来源:AboutDialog.java

示例13: sendOAuthHTTPRequest

/**
 * Login with OAuth utilities
 */
/*
 * Login with OAuth requires the priming of "pending credentials" on the server to receive a secret
 */
private void sendOAuthHTTPRequest(String serviceName, String accessToken, String credentialToken, Response.Listener listener) {
    RequestQueue queue = Volley.newRequestQueue(mContext);
    String url = "http://" + getServerHostname() + ":" + getServerPort() + "/_oauth/" + serviceName + "/";
    //as far as I know, Facebook is the only one that only returns a long-lived token on mobile login
    String params;
    if (accessTokenServices.contains(serviceName)) {
        params = "?accessToken=" + accessToken + "&state=" + generateState(credentialToken);
    } else {
        params = "?code=" + accessToken + "&state=" + generateState(credentialToken);
    }

    StringRequest request = new StringRequest(Request.Method.GET, url + params,
            listener, new Response.ErrorListener() {
        @Override
        public void onErrorResponse(VolleyError error) {
            error.printStackTrace();
            if (BuildConfig.DEBUG) {
                log.debug("If you're getting a weird error, " +
                        "this could be because you haven't configured " +
                        "your server for ddp loginWithOAuth yet. " +
                        "For Facebook login, remove accounts-facebook " +
                        "and add jasperlu:accounts-facebook-ddp instead.");
            }
        }
    });

    queue.add(request);
}
 
开发者ID:kenyee,项目名称:android-ddp-client,代码行数:34,代码来源:DDPStateSingleton.java

示例14: generateState

private String generateState(String credentialToken) {
    JSONObject json = new JSONObject();
    try {
        json.put("credentialToken", credentialToken);
        json.put("loginStyle", "popup");
    } catch(Exception e) {
        log.warn(e.getMessage());
    }
    if (BuildConfig.DEBUG) {
        log.debug(json.toString());
    }
    return Base64.encodeToString(json.toString().getBytes(), Base64.URL_SAFE|Base64.NO_WRAP|Base64.NO_PADDING);
}
 
开发者ID:kenyee,项目名称:android-ddp-client,代码行数:13,代码来源:DDPStateSingleton.java

示例15: d

public static void d(final String tag, String message) {
    // include logging only in debug versions
    if (BuildConfig.DEBUG || mTesting) {
        Log.d(tag, message);
    }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:6,代码来源:LogHelper.java


注:本文中的android.support.v4.BuildConfig.DEBUG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。