android – 青春部落,流年似水 http://www.youthtribe.com 青春是一场远行,总记不起来时的路。 Tue, 02 Nov 2021 09:08:25 +0000 zh-CN hourly 1 https://wordpress.org/?v=6.1.7 android – 青春部落,流年似水 http://www.youthtribe.com/archives/1915 http://www.youthtribe.com/archives/1915#respond Tue, 02 Nov 2021 09:07:41 +0000 http://www.youthtribe.com/?p=1915
 
android:text="  号:"
]]>
http://www.youthtribe.com/archives/1915/feed 0
android – 青春部落,流年似水 http://www.youthtribe.com/archives/1707 http://www.youthtribe.com/archives/1707#respond Wed, 28 Jun 2017 06:24:57 +0000 http://www.youthtribe.com/?p=1707 问题描述:下载支付宝提供的android手机支付demo时,发现当手机没有安装支付宝客户端时不能正常唤起H5支付界面。

解决办法:修改signutils.java文件中的

KeyFactory keyf = KeyFactory.getInstance(ALGORITHM);

修改为:

KeyFactory keyf = KeyFactory.getInstance(ALGORITHM,"BC");

即可。具体原因懒得查。这解决方法也是网上找的。出处已忘。

希望支付宝官方尽快修正此bug。

安卓版本:4.2.2


悲剧的是在6.0上,也扔不能正常唤起H5支付。。。

解决了,安卓6.0以下,对权限做了一些修改。大概就是一些相对重要的权限如果没有做出开启提醒,同时没有做相应错误处理,就会导致异常。

我是在程序manifest.xml中加了以下几个权限,现在也可以正常唤醒程序了:

<!-- 允许读取手机状态的权限 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

 

]]>
http://www.youthtribe.com/archives/1707/feed 0
android – 青春部落,流年似水 http://www.youthtribe.com/archives/1702 http://www.youthtribe.com/archives/1702#respond Tue, 20 Jun 2017 03:28:56 +0000 http://www.youthtribe.com/?p=1702 在线网址:

http://inloop.github.io/svg2android/

 

Bake transforms into path (experimental) 这个选项不要勾选

]]>
http://www.youthtribe.com/archives/1702/feed 0
android – 青春部落,流年似水 http://www.youthtribe.com/archives/1677 http://www.youthtribe.com/archives/1677#respond Fri, 02 Jun 2017 11:22:09 +0000 http://www.youthtribe.com/?p=1677  

首先添加:

private RequestQueue mRequestQueue;

在oncreate添加

mRequestQueue = Volley.newRequestQueue(this);


JsonObjectRequest post请求并用添加参数

HashMap<String,String> map = new HashMap<String,String>();
map.put("customer_type",strCustomerType);
map.put("customer_code",strCustomerCode);
map.put("student_code",strStudentCode);
map.put("student_password",strStudentPassword);

JSONObject params = new JSONObject(map);

String strURL = DaJuanApp.getBindURL(strCustomerType,strCustomerCode) + DaJuanApp.getTokenQueryParam(BindActivity.this);
//Toast.makeText(BindActivity.this, strURL, Toast.LENGTH_SHORT).show();
//
/*
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest( Request.Method.POST,
strURL,
params,
new Listener() {
@Override
public void onResponse(JSONObject jsonObject) {

try{

String str = jsonObject.get(“code”).toString() + “:” + jsonObject.get(“message”).toString();

if ( jsonObject.get(“code”).toString().equals(“200″)) {
//成功
Toast.makeText(BindActivity.this, str, Toast.LENGTH_SHORT).show();
//DaJuanApp.setConfigValue(LoginActivity.this,”Telephone”,strTelephone);

}
else
{
//失败
//Toast.makeText(RegisterActivity.this, jsonObject.get(“message”).toString(), Toast.LENGTH_SHORT).show();
boolean bRes = DaJuanApp.getInstance().notLogin(BindActivity.this,jsonObject);
if (bRes){
return;
}
Dialog dialog = new AlertDialog.Builder(BindActivity.this)
.setTitle(“提示”)
//.setIcon(R.drawable.questionmark)
.setMessage(str)
.setPositiveButton(“确定”, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

}
})
.create();
dialog.show();

}

}
catch (JSONException e)
{
Toast.makeText(BindActivity.this, e.getMessage().toString(), Toast.LENGTH_SHORT).show();

}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {

String str = volleyError.toString();

Toast.makeText(BindActivity.this, str, Toast.LENGTH_LONG).show();

}
});
mRequestQueue.add(jsonObjectRequest);


StringRequest post请求并添加参数:

StringRequest sr = new StringRequest(
        Request.Method.POST,
        strURL,
        new Response.Listener<String>() {
            @Override
            public void onResponse(String response) {                                
                Toast.makeText(BindActivity.this, response, Toast.LENGTH_LONG).show();
                tvInfo.setText(response);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                //Toast.makeText(BindActivity.this, error.getMessage(), Toast.LENGTH_LONG).show();
                //tvInfo.setText(error.getMessage().toString());
                tvInfo.setText("请求错误");
            }
        }){
    @Override
    protected Map<String, String> getParams()  {

        HashMap<String,String> map = new HashMap<String,String>();
        map.put("customer_type","school");
        map.put("customer_code","cszx");
        map.put("student_code","26272062");
        map.put("student_password","dajuan2017");

        //JSONObject params = new JSONObject(map);
        return map;
    }


};
mRequestQueue.add(sr);
]]>
http://www.youthtribe.com/archives/1677/feed 0
android – 青春部落,流年似水 http://www.youthtribe.com/archives/1604 http://www.youthtribe.com/archives/1604#respond Sat, 19 Nov 2016 03:33:22 +0000 http://www.youthtribe.com/?p=1604 在用android studio 可能会由于某种原因,需要给电脑上的手机虚拟机安装所需要的相关库,或者软件。那怎么安装呢。

现在写一下安装方法:

首先把虚拟机启动起来!

把你要安装的apk文件,复制到你的虚拟机的adb.exe同目录下。比如我的路径为:

D:\Android\sdk\platform-tools

我的apk文件名为:1.apk

然后启动命令行窗口。输入命令:

adb install 1.apk

这样就可以了!很简单


ANDROID STUDIO 如何给虚拟机安装APK软件
ANDROID STUDIO 如何给虚拟机安装APK软件

]]>
http://www.youthtribe.com/archives/1604/feed 0