小编And*_*son的帖子

使用intellij在设备上INSTALL_FAILED_CPU_ABI_INCOMPATIBLE

我已经看到了一些关于这个的问题,但没有一个有真正的答案和细节.这是我的情况:

我有一个使用Google Maps API v2的应用程序,它运行得很好.最近我发现我无法在这个基于ARM的设备上安装它.

为了解决这个问题,我正在使用随SDK提供的Google地图示例(\ sdk\extras\google\google_play_services\samples)

这在安装时给出了相同的错误消息:

Failure [INSTALL_FAILED_CPU_ABI_INCOMPATIBLE]

我只在使用Intellij(12.1.1)的真实设备上收到此消息

它可以在真实设备上使用Eclipse并在配置了CPU的仿真器上使用Intellij:Intel Atom(x86)

任何帮助将非常感谢!

UPDATE

正如预期的那样,Android Studio也会发生同样的事情

android google-maps intellij-idea android-studio

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

在没有重建项目的情况下在Android Studio中找不到符号

当我尝试将我的项目部署到模拟器时,编译失败了一堆无法找到符号错误.我必须重建项目,然后每次进行更改时进行部署.这对我来说只是0.1.6.其他人看到这个?

android symbols android-studio

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

关于未分配的变量

只是好奇,我不是想解决任何问题.

为什么只应分配局部变量?

在以下示例中:

class Program
{
    static int a;
    static int b { get; set; }
    static void Main(string[] args)
    {
        int c;
        System.Console.WriteLine(a);
        System.Console.WriteLine(b);
        System.Console.WriteLine(c);
    }
}
Run Code Online (Sandbox Code Playgroud)

为什么ab给我一个警告并c给我一个错误?

另外,为什么我不能只使用Value Type的默认值并编写以下代码?

        bool MyCondition = true;
        int c;
        if (MyCondition)
            c = 10;
Run Code Online (Sandbox Code Playgroud)

它与内存管理有什么关系吗?

c#

13
推荐指数
3
解决办法
927
查看次数

将左边缘对齐到中心 - RelativeLayout

我有以下要求(大大简化):

在此输入图像描述

文本2必须从屏幕的中心开始.

我只能用LinearLayout来实现这个目的:

<more_code></more_code><LinearLayout
                                    android:baselineAligned="false"
                                    android:weightSum="2"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content">

                                <LinearLayout
                                        android:layout_weight="1"
                                        android:orientation="horizontal"
                                        android:layout_width="0dp"
                                        android:layout_height="wrap_content">
                                    <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="test one"/>
                                    <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="test two"/>
                                </LinearLayout>

                                <LinearLayout
                                        android:layout_weight="1"
                                        android:orientation="horizontal"
                                        android:layout_width="0dp"
                                        android:layout_height="wrap_content">
                                    <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="test three"/>

                                    <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="test four"/>
                                </LinearLayout>
                            </LinearLayout><more_code></more_code>
Run Code Online (Sandbox Code Playgroud)

因为我已经有太多的嵌套视图(因此获取myfile.xml有10个级别,对性能警告不好)我想知道我是否可以使用一个RelativeLayout获得相同的结果.我一直在阅读文档,但我找不到允许我这样做的属性.

android android-layout

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

月份不会从日期打印 - Java DateFormat

如何从java中的日期获取月份:

        DateFormat inputDF  = new SimpleDateFormat("mm/dd/yy");
        Date date1 = inputDF.parse("9/30/11");

        Calendar cal = Calendar.getInstance();
        cal.setTime(date1);

        int month = cal.get(Calendar.MONTH);
        int day = cal.get(Calendar.DAY_OF_MONTH);
        int year = cal.get(Calendar.YEAR);

        System.out.println(month+" - "+day+" - "+year);
Run Code Online (Sandbox Code Playgroud)

此代码返回日期和年份,但不是月份.

输出:

0 - 30 - 2011
Run Code Online (Sandbox Code Playgroud)

java calendar date date-format

10
推荐指数
2
解决办法
5万
查看次数

在谷歌地图android中沿着路径动画汽车(标记)

如果你有List,我将分享一个沿着路径移动标记的解决方案.位图将沿着使用LatLng列表的路径移动.

android android-maps-v2

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

LocationManager和LocationClient一起获取用户位置

我只需要获取用户位置.优选地,确切的位置,但如果不可能,粗略的位置将是好的.

根据文件:

LocationClient.getLastLocation()

Returns the best most recent location currently available.

LocationManager.getLastKnownLocation(字符串)

Returns a Location indicating the data from the last known location fix obtained from the given provider.

如果我的理解是对的,那么前者会给我一个非常好的结果(或者有时为空),而后者会给我一个很少会为空的结果.

这是我的代码(简化)

locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationClient = new LocationClient(this, this, this);

@Override
public void onConnected(Bundle dataBundle) {
    setUserLocation();
}

private void setUserLocation() {
    myLocation = locationClient.getLastLocation();

    if (myLocation == null) {
        myLocation = locationManager.getLastKnownLocation(locationManager.getBestProvider(new Criteria(), false));
        if (myLocation == null) {
            //I give up, just set the map somewhere …
Run Code Online (Sandbox Code Playgroud)

android location

8
推荐指数
1
解决办法
4836
查看次数

Transfuse与AndroidAnnotations

我想知道是否有人使用Transfuse以及它与Android Annotations的区别.我的意思是每个人的利弊,除了这两个之外还有其他选择.

谢谢.

android android-annotations transfuse

8
推荐指数
1
解决办法
1633
查看次数

在Google的Geofencing教程中没有看到Geofence Transitions

我正在尝试使用Google的示例测试地理围栏功能:创建和监控地理围栏.我在这里上传了代码.

问题是我从未收到进入或退出的通知.我有Wifi,4G和GPS.我试过用以下方法测试:

  1. 我甚至走出我的房子大约50英尺,然后走回来 - 但没有通知.我可以看到播放服务已连接,甚至"MainActivity.java中的GeofenceUtils.ACTION_GEOFENCES_ADDED"被触发,所以我认为Geofences正在被正确添加.
  2. 在设置中启用模拟位置并使用此假GPS应用程序并更改位置 - 从与Geofence1相同的坐标开始,然后设置为完全外部(在另一个状态) - 但我仍然没有得到退出通知.

我究竟做错了什么?ANyone成功运行了这个谷歌的例子:创建和监控地理围栏.我在这里上传了代码以便于浏览.

我只是想学习Geofencing - 检测进入和退出.我将标记任何答案作为我可以用来在我的真实设备上进行地理工作的正确答案

我输入下面的坐标和半径.

android location geofencing android-geofence

7
推荐指数
2
解决办法
6088
查看次数

找不到参数的方法release()

我刚刚将我的项目更新为Android Gradle插件0.9.0,并且在尝试运行我的项目时出现以下错误:

FAILURE: Build failed with an exception.

* Where:                    
Build file 'C:\...\facebookSDK\build.gradle' line: 12

* What went wrong:          
A problem occurred evaluating project ':facebookSDK'.
> Could not find method release() for arguments [build_3ug2bdgu6mi6jljp3krac916n3$_run_closure1_closure4@e1bf3ff] on project ':facebookSDK'.

* Try:                      
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
Run Code Online (Sandbox Code Playgroud)

我只用我的一个项目得到这个错误.如果我切换回0.8.+它工作正常.

这是facebookSDK模块的gradle.build文件.

apply plugin: 'android-library'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.3"

    defaultConfig {
        minSdkVersion 8
        targetSdkVersion 8 …
Run Code Online (Sandbox Code Playgroud)

android gradle facebook-android-sdk

6
推荐指数
1
解决办法
5661
查看次数