我使用的是Android Studio v 0.5.7.问题是,在"Bin"文件夹中我的apk文件存在,但它不是自动构建的.也就是说,它显示了我的旧APK.
当我搜索这个问题时,我发现在"Build"文件夹中生成了一个"apk"文件夹,它显示了更新的apk文件.但是我在"Build"文件夹中没有"apk"文件夹.
那么,我怎样才能在Android Studio中获取最新的apk文件?
我已经完成了开发一个使用facebook sdk与Facebook集成的Android应用程序.我没有任何问题或问题需要解决这个应用程序,因为它功能齐全,运行良好 - 但据说我相信即使应用程序运行,我仍然不完全明白什么是Android密钥哈希.
1)我理解facebook sdk为开发人员提供了一个独特的应用程序ID,以便知道他们与谁"交谈",这样他们也可以控制谁是谁等等,但是他们从你的android密钥哈希获得了什么?
2)我明白我的开发PC上的模拟器有一个密钥哈希(我得到),三星Galaxy S1和S2(两者都有相同的密钥哈希)有一个不同的,现在我已通过apk另一个用户具有不同的密钥哈希(以及不同的手机品牌和Android版本).那么 - 如果我有一天在Google Play上发布我的应用程序,我是否需要更新所有可能的哈希密钥的Facebook /开发人员?
3)哈希键对于模型或平台/ android版本是唯一且恒定的,或者我可以从我的应用程序生成密钥哈希所以我可以添加它并使从不同手机运行的所有相同的应用程序使用相同的?
4)一般来说 - 我不明白什么是关键哈希,谁生成它,最重要的是为什么 - 关键哈希的用途是什么,以及它对Facebook有什么好处?
我试图搜索它,但是在这里我发现了关于知道什么是模拟器密钥哈希的步骤的问题或者关于如何处理谷歌上的Facebook /开发者的指示.我确信有文件涵盖了这个,找不到它.
谢谢!
String response = getResultForRequest(url);
Run Code Online (Sandbox Code Playgroud)
其中'url'是JSON格式的,使用http GET方法返回数据束.
public static String getResultForRequest(String urlString)
throws IOException {
URL url = new URL(urlString);
HttpURLConnection urlConnection = (HttpURLConnection) url
.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setDoInput(true);
urlConnection.setDoOutput(true);
urlConnection.connect();
InputStream is = urlConnection.getInputStream();
if (is == null)
return null;
StringBuffer sb = new StringBuffer();
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String line = null;
try {
while ((line = br.readLine()) != null)
sb.append(line);
} finally {
br.close();
is.close();
}
return sb.toString();
}
Run Code Online (Sandbox Code Playgroud)
我无法从我在getResultForRequest(url)方法中传递的'url'中获取JSON格式的数据.我在urlConnection.connect()中遇到错误; .AndroidManifest.xml文件中也提供了Internet权限.
这是我的日志. …
我正在开发导航基础应用程序.在这些应用程序中,我必须打开Map应用程序以使用Traffic Enable绘制源和目标纬度/地址之间的路径.
我已经创建了通过Intent打开Google地图的功能,并绘制了两点之间的路径.
是否有可能在传递Intent时添加流量层?或者我需要添加哪个参数?
提前致谢.
我想在onCreate()方法中获得Middle(Body)布局的高度/宽度.
我的main.xml是:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl_Main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/main_bg11" >
<RelativeLayout
android:id="@+id/rl_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true" >
<include layout="@layout/title" />
</RelativeLayout>
<ScrollView
android:id="@+id/svtest"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/rl_music_controller"
android:layout_below="@+id/rl_title" >
<RelativeLayout
android:id="@+id/rl12"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center" >
<TableLayout
android:id="@+id/tbl_vandana"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center_horizontal"
android:paddingTop="30dp" >
</TableLayout>
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="@+id/rl_music_controller"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<include layout="@layout/controller" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
我在TableLayout中动态添加Textview.ID :
rl_title是我的标题布局
svtest是我的中间(身体)内容.
rl_music_controller是我的页脚布局.
我指的是这个链接.但我不明白我到底做了什么?
我有另一个.android文件夹.如何更改MAC OS X中.android文件夹的路径?是否需要更改路径,如Windows 7/8中的更改?
提前致谢.
编辑
我有.android文件夹,它位于Windows 7笔记本电脑中的c:\ users\USERNAME.android中.在Windows 7中,有环境变量选项来设置另一个.android文件夹路径.但如果我想在MAC OS X中做同样的事情,那我该怎么做呢?