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


Java GoogleAccountCredential.initialize方法代码示例

本文整理汇总了Java中com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.initialize方法的典型用法代码示例。如果您正苦于以下问题:Java GoogleAccountCredential.initialize方法的具体用法?Java GoogleAccountCredential.initialize怎么用?Java GoogleAccountCredential.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential的用法示例。


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

示例1: getMBSEndpoint

import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential; //导入方法依赖的package包/类
private Mobilebackend getMBSEndpoint() {

        // check if credential has account name
        final GoogleAccountCredential gac = mCredential == null
                || mCredential.getSelectedAccountName() == null ? null : mCredential;

        // create HttpRequestInitializer
        HttpRequestInitializer hri = new HttpRequestInitializer() {
            @Override
            public void initialize(HttpRequest request) throws IOException {
                request.setBackOffPolicy(new ExponentialBackOffPolicy());
                if (gac != null) {
                    gac.initialize(request);
                }
            }
        };

        // build MBS builder
        // (specify gac or hri as the third parameter)
        return new Mobilebackend.Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(),
                hri)
                .setRootUrl(Consts.ENDPOINT_ROOT_URL).build();
    }
 
开发者ID:pkill9,项目名称:POSproject,代码行数:24,代码来源:CloudBackend.java

示例2: getMBSEndpoint

import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential; //导入方法依赖的package包/类
private Mobilebackend getMBSEndpoint() {

    // check if credential has account name
    final GoogleAccountCredential gac = credential == null
        || credential.getSelectedAccountName() == null ? null : credential;

    // create HttpRequestInitializer
    HttpRequestInitializer hri = new HttpRequestInitializer() {
      @Override
      public void initialize(HttpRequest request) throws IOException {
        request.setBackOffPolicy(new ExponentialBackOffPolicy());
        if (gac != null) {
          gac.initialize(request);
        }
      }
    };

    // build MBS builder
    // (specify gac or hri as the third parameter)
    return new Mobilebackend.Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(), hri)
        .setRootUrl(Consts.ENDPOINT_ROOT_URL).build();
  }
 
开发者ID:harrypritchett,项目名称:Give-Me-Ltc-Android-App,代码行数:23,代码来源:CloudBackend.java

示例3: getMBSEndpoint

import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential; //导入方法依赖的package包/类
private Mobilebackend getMBSEndpoint() {

        // check if credential has account name
        final GoogleAccountCredential gac = credential == null || credential.getSelectedAccountName() == null ? null
                : credential;

        // create HttpRequestInitializer
        HttpRequestInitializer hri = new HttpRequestInitializer() {
            @Override
            public void initialize(HttpRequest request) throws IOException {
                request.setBackOffPolicy(new ExponentialBackOffPolicy());
                if (gac != null) {
                    gac.initialize(request);
                }
            }
        };

        // build MBS builder
        // (specify gac or hri as the third parameter)
        return new Mobilebackend.Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(), hri).setRootUrl(
                Consts.ENDPOINT_ROOT_URL).build();
    }
 
开发者ID:yanzm,项目名称:MobileBackendStarter,代码行数:23,代码来源:CloudBackend.java


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