小编Kas*_*ala的帖子

使用Google登录Android获取用户的出生日期和性别

我已经集成Google Sign-In了我的应用程序.我可以得到用户EmailDisplayName.现在,我希望获得用户BirthdateGender.

我已经添加了所有必需的requestsScopesGoogleApiClient其所有被授权的API.这是代码.

    // [START configure_signin]
    // Configure sign-in to request the user's ID, email address, and basic
    // profile. ID and basic profile are included in DEFAULT_SIGN_IN.
    GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestEmail()
            .requestProfile() <- This
            .requestScopes(
                    new Scope(Scopes.PLUS_ME), new Scope(Scopes.PROFILE) <- This
            )
            .build();
    // [END configure_signin]

    // [START build_client]
    // Build a GoogleApiClient with access to the Google Sign-In API and …
Run Code Online (Sandbox Code Playgroud)

android google-plus google-play-services google-signin

22
推荐指数
2
解决办法
1万
查看次数

PHP - CURL已启用但无法正常工作

我正试图从外部网站获取数据cURL,PHP但不知何故它不起作用.

我已经检查了CURL启用phpinfo().它显示cURL已启用cURL已启用

但是,我的代码不起作用.

<?php
if (! function_exists ( 'curl_version' )) {
    exit ( "Enable cURL in PHP" );
}

$ch = curl_init ();
$timeout = 0; // 100; // set to zero for no timeout
$myHITurl = "http://www.google.com";
curl_setopt ( $ch, CURLOPT_URL, $myHITurl );
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );
$file_contents = curl_exec ( $ch );
if (curl_errno …
Run Code Online (Sandbox Code Playgroud)

php curl

4
推荐指数
1
解决办法
3万
查看次数

Android Studio 1.5.1中的Gradle构建失败

我无法运行我的应用程序.每次我试图在模拟器中运行我的应用程序时,Android工作室都会显示以下错误.

错误:任务执行失败':app:transformClassesWithDexForDebug'.> com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'命令'C:\ Program Files(x86)\ Java\jdk1.8.0_66\bin\java.exe''以非零退出值2结束

这是我的build.gradle文件.

build.gradle(app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    defaultConfig {
        applicationId "com.gripxtech.kasim.unipayretailer"
        minSdkVersion 10
        targetSdkVersion 23
        versionCode 1
        versionName '1.0'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.malinskiy:superrecyclerview:1.1.1'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'com.codinguser.android:contactpicker:3.0.0@aar'
    compile 'com.squareup.okhttp:okhttp:2.7.0'
    compile …
Run Code Online (Sandbox Code Playgroud)

java android android-studio android-gradle-plugin

3
推荐指数
1
解决办法
4621
查看次数

如何将ULONGLONG转换为CString

我正在使用vs-2013进行MFC应用程序开发,我的MFC项目的字符集是多字节字符集,
我想知道如何在MFC应用程序中将ULONGLONG数据类型转换为CString

mfc visual-c++

0
推荐指数
1
解决办法
1250
查看次数

Kotlin - 非法使用内联参数回调

我将我的functionlambda作为parameterinline function性能改进.

listlambda类型的MutableList<(Authenticate) -> Unit>变量作为类数据成员.当我尝试添加lambda parameterlist.

Kotlin编译器说:

非法使用内联参数回调

这是代码

// Some code skipped
object Odoo {

    val pendingAuthenticateCallbacks = mutableListOf<(Authenticate) -> Unit>()

    inline fun authenticate(
        login: String, password: String, database: String,
        quick: Boolean = false, crossinline callback: Authenticate.() -> Unit
    ) {
        // Following statement has error saying
        // Illegal usage of inline parameter callback. add 'noinline' modifier to parameter declaration.
        pendingAuthenticateCallbacks …
Run Code Online (Sandbox Code Playgroud)

lambda android inline kotlin

0
推荐指数
1
解决办法
503
查看次数