小编kar*_*ran的帖子

如何在Android中的G +登录按钮中心设置textview

我在我的代码中使用了G + signinbutton,它的登录工作正常.我在我的xml中使用下面的代码设置它

<com.google.android.gms.common.SignInButton
            android:id="@+id/btn_sign_in"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:textSize="15dp"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="2dp"
            android:layout_marginRight="2dp"
            />
Run Code Online (Sandbox Code Playgroud)

我现在拥有的如下 在此输入图像描述

现在我想将TextView设置为按钮的中心.但是,SignInButton似乎没有android:gravity如何将我的TextView设置为居中?

android gravity google-login

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

Android Volley签署了Apk问题

我正在使用一个应用程序,我正在使用volley plus和android studio.我正在使用volley plus gradle版本'dev.dworks.libs:volleyplus:+'gradle.当我签署我的应用程序的apk时,我的构建过程终止了一些警告和runProguard错误.有任何解决方案可以解决这个问题.

Warning:com.android.volley.toolbox.HttpClientStack$HttpPatch: can't find superclass or interface org.apache.http.client.methods.HttpEntityEnclosingRequestBase
Warning:com.android.volley.toolbox.multipart.MultipartEntity: can't find superclass or interface org.apache.http.entity.AbstractHttpEntity
Warning:com.android.volley.cache.SimpleImageLoader: can't find referenced class android.net.http.AndroidHttpClient
Warning:com.android.volley.cache.plus.SimpleImageLoader: can't find referenced class android.net.http.AndroidHttpClient
Warning:com.android.volley.misc.MultipartUtils: can't find referenced class org.apache.http.util.EncodingUtils
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.HttpResponse
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.Header
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.HttpResponse
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.Header
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.HttpResponse
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.Header
Warning:com.android.volley.misc.Utils: can't find referenced class org.apache.http.HttpResponse
Warning:com.android.volley.toolbox.BasicNetwork: …
Run Code Online (Sandbox Code Playgroud)

android signed apk android-volley

4
推荐指数
2
解决办法
3331
查看次数

为什么java程序输出以下内容

下面是实现时间服务器的代码

服务器类

public static void main(String args[])
    {
   try{
            ServerSocket ss=new ServerSocket(990);
             Socket s=ss.accept();
            while(true)
            {
                Calendar c=Calendar.getInstance();
                BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));
                PrintWriter out =new PrintWriter(new OutputStreamWriter(s.getOutputStream()));
                out.println("Hello This is server & My Time is :");
                out.println("Time :::  Hour="+c.HOUR +" Min="+c.MINUTE +" sec="+c.SECOND);
            out.flush();
              s.close();
            }
        }
        catch(Exception e)
        {
        }
    }
Run Code Online (Sandbox Code Playgroud)

客户类

public static void main(String args[])
    {
   try{
            ServerSocket ss=new ServerSocket(990);
             Socket s=ss.accept();
            while(true)
            {
                Calendar c=Calendar.getInstance();
                BufferedReader in=new BufferedReader(new InputStreamReader(s.getInputStream()));
                PrintWriter out =new PrintWriter(new OutputStreamWriter(s.getOutputStream()));
                out.println("Hello This …
Run Code Online (Sandbox Code Playgroud)

java time calendar

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

未使用Google Places API获取商家信息数据 - 此API项目无权使用此API

我正在使用此处提出的问题的代码自动完成textview google places api description - > place_id.我更改了代码以将其添加到我的应用程序中.当我运行代码时,它在我运行代码时给出了以下响应

07-28 11:17:19.244: E/result(350): {"error_message":"This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https:\/\/code.google.com\/apis\/console","predictions":[],"status":"REQUEST_DENIED"}
Run Code Online (Sandbox Code Playgroud)

我搜索了一些线程,并从下面的线程

  1. 用于地理编码的Maps API密钥无法正常工作
  2. 此IP,站点或移动应用程序无权使用此API密钥 和一个或两个其他API密钥

我按照建议做了以下步骤.

  1. 从控制台创建服务器密钥并将其添加到项目中.
  2. Places API从控制台启用.
  3. Geocoding API从控制台启用.

您可以在下图中看到. 在此输入图像描述

当我运行代码时,它仍然显示上面提到的错误.我是否需要从控制台启用任何其他API.

除此之外,地图工作得很好.如果您想知道这是我在清单中添加的api密钥.

<!-- Goolge Maps API Key Development mode -->
            <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyAbo3luzbyQTuuPLOyo_Ml***********" />
Run Code Online (Sandbox Code Playgroud)

我正在直接添加服务器密钥以请求URL,如下所示

private ArrayList<String> autocomplete(String input) {
ArrayList<String> resultList = null;
    HttpURLConnection conn …
Run Code Online (Sandbox Code Playgroud)

android autocompletetextview google-geocoding-api google-places-api google-maps-android-api-2

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

任何更好的方法来实现这一点

当我遇到这个算法(进行更改)并在下面实现它时,我正在网上冲浪...但仍然有任何有效的方法来做到这一点......我怎么能从我实施的程序中找到相同的复杂性...

1>算法如下

makechange(c[],n) //c will contain the coins which we can take as our soln choice and 'n' is the amount we want change for
soln<-NULL//set that will hold solution
sum=0
while(sum!=n)
{
    x<-largest item in c such that sum+x<=n
    if(there is no such item)
    return not found
    soln <- soln U {a coin of value x}
    sum=sum+x
    return soln
}

2>here is what i have tried

#include<stdio.h>
#include<conio.h>

void main() {
    int c[]= {100,50,20,10,5,1},soln[6];
    int num,i,j,sum=0,x,k,flag=0;
    clrscr();
    printf("\nEnter amount …
Run Code Online (Sandbox Code Playgroud)

c c++ algorithm

-1
推荐指数
1
解决办法
469
查看次数