小编Ano*_* CH的帖子

在Android中集成FaceBook,Twitter,社交网络

使用单个通用框架或API或JAR将多个社交网络集成到Android中

对于iPhone,我们有ShareKit,它在一个框架中集成了多个共享选项. http://www.getsharekit.com/

对于android我不知道是否存在类似的东西.我正在构建一个向社交网络共享信息的应用程序,比如一些帖子和推文.它是一个简单的游戏,游戏玩家发布有关他们的成就和等级的更新等.我使用Facebook和Twitter API,但他们占用了大量内存,难以管理.我也无法有效地处理它们.任何有关如何整合它们的帮助将不胜感激.

我想对此有一些建议..

另一个例子似乎是PinkelStar

http://www.pinkelstar.com/ (不再维护)

谢谢

twitter android facebook social-networking

52
推荐指数
4
解决办法
5万
查看次数

如何在linux上设置android SDK进行命令行开发?

我正在尝试设置android SDK以在Linux(Ubuntu 9.10)的命令行上开发一个简单的程序.我尝试了eclipse,但它已经知道在Ubuntu上运行的问题,所以我放弃了它.这是我到目前为止所做的:

  1. http://developer.android.com/sdk/index.html下载了android-sdk_r05-linux_86.tgz
  2. tar xvzf android-sdk_r05-linux_86.tgz
  3. ln -s android-sdk-linux_86 android
  4. 在.tcshrc中添加了setenv PATH .....:/ home/user/android/tools
  5. source .tcshrc
  6. 跑'android'.这开了一个gui.在可用的包下:我安装了所有东西,并退出了gui.
  7. 跑'android list targets'并列出了这些:

可用的Android目标:

id:1或"android-3"名称:Android 1.5类型:平台API级别:3修订版:1皮肤:HVGA-P,HVGA(默认),QVGA-P,QVGA-L,HVGA-L

id:2或"Google Inc.:Google API:3"名称:Google API类型:附加组件供应商:Google Inc.修订版:3说明:Android + Google API基于Android 1.5(API级别3)库:*com谷歌地图皮肤的.google.android.maps(maps.jar)API:QVGA-P,HVGA-L,HVGA(默认),QVGA-L,HVGA-P

id:3或"android-4"名称:Android 1.6类型:平台API级别:4版本:1皮肤:HVGA(默认),WVGA800,WVGA854,QVGA

id:4或"Google Inc.:Google API:4"名称:Google API类型:附加组件供应商:Google Inc.修订版:2说明:Android + Google API基于Android 1.6(API级别4)库:*com谷歌地图皮肤的.google.android.maps(maps.jar)API:WVGA854,HVGA(默认),QVGA,WVGA800

id:5或"android-6"名称:Android 2.0.1类型:平台API级别:6修订版:1皮肤:WQVGA432,HVGA(默认),WVGA800,WVGA854,WQVGA400,QVGA id:6或"Google Inc.: Google API:6"名称:Google API类型:附加组件供应商:Google Inc.修订版:1说明:Android + Google API基于Android 2.0.1(API级别6)库:*com.google.android.maps( maps.jar)Google Maps皮肤的API:WQVGA400,WVGA854,HVGA(默认),WQVGA432,QVGA,WVGA800

id:7或"android-7"名称:Android 2.1类型:平台API级别:7修订版:1皮肤:WQVGA432,HVGA(默认),WVGA800,WVGA854,WQVGA400,QVGA

id:8或"Google Inc.:Google API:7"名称:Google API类型:附加组件供应商:Google Inc.修订版:1说明:Android + Google API基于Android 2.1(API级别7)库:*com适用于Google Maps皮肤的.google.android.maps(maps.jar)API:WQVGA400,WVGA854,HVGA(默认),WQVGA432,QVGA,WVGA800

我想为我的motorola机器人创建一个简单的hello world程序.我应该使用以下哪些目标?

我怎么看皮肤?

如果我从命令行运行'android',它表示没有虚拟设备.虚拟设备是否与目标相同?

如何获得机器人皮肤和/或机器人目标和/或机器人虚拟设备?


我认为我需要运行类似'android create avd …

linux android motorola android-emulator

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

通过代码/程序关闭或重新启动Android设备?

有没有办法直接从应用程序重启/关闭手机?

例如:当我遇到某些特定情况时,我需要重新启动/关闭手机...

引用开发者网站:

重启权限?

http://developer.android.com/reference/android/Manifest.permission.html#REBOOT

砖设备的许可???

http://developer.android.com/reference/android/Manifest.permission.html#BRICK

重启的方法???

http://developer.android.com/reference/android/os/PowerManager.html#reboot%28java.lang.String%29

重启和擦除的方法??

http://developer.android.com/reference/android/os/RecoverySystem.html#rebootWipeUserData%28android.content.Context%29

MonkeyRunner/MonkeyDevice中的重启方法:

http://developer.android.com/guide/developing/tools/MonkeyDevice.html#reboot

有一些选项可以阻止设备,但为什么不关闭或重启?

我尝试了以下代码,但它抛出异常..

的Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.schogini.PowerOff"
      android:versionCode="1"
      android:versionName="1.0">


    <uses-permission android:name="android.permission.REBOOT" />
    <uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
    <uses-permission android:name="android.permission.DEVICE_POWER" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".PowerOffActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>
</manifest>
Run Code Online (Sandbox Code Playgroud)

Java代码:

package com.schogini.PowerOff;


import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.PowerManager;
import android.view.View;
import android.widget.Button;


public class PowerOffActivity extends Activity {

    PowerManager pm;

    /** Called when the activity is first …
Run Code Online (Sandbox Code Playgroud)

android android-ndk android-manifest

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

Android没有真正的wchar_t吗?

我建立了一个简单的方法如下

wchar_t buf[1024] = {};
void logDebugInfo(wchar_t* fmt, ...)
{  
    va_list args;
    va_start(args, fmt);
    vswprintf( buf, sizeof(buf), fmt, args);
    va_end(args);
}

jstring Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
                                              jobject thiz )
{
    logDebugInfo(L"test %s, %d..", L"integer", 10);
    return (*env)->NewStringUTF(env, buf);
}
Run Code Online (Sandbox Code Playgroud)

我得到了以下警告

在函数'Java_com_example_hellojni_HelloJni_stringFromJNI'中:
警告:从不兼容的指针类型传递'logDebugInfo'的参数1
注意:期望'wchar_t*'但参数的类型为'unsigned int*'

结果字符串不正确.如果我在格式化字符串之前删除了那个L前缀,很奇怪,它有效.但是我的遗留代码中到处都使用了L前缀.

首先我知道wchar_t不够便携,并且特定于编译器.我期望的wchar_t的大小应该是16位.我读了一些其他帖子说它是32位的android而wchar.h,由官方NDK提供,它说wchar_t == char,真的吗?

c java-native-interface android android-ndk

7
推荐指数
1
解决办法
8149
查看次数

如何绕过ICS和Jellybean中不一致的DatePicker Widget

我在Android中使用Datepicker.我在Jellybean中得到了一个完整的Bizzare UI.

在此输入图像描述

这是布局代码:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollView1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/stores"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <Spinner
            android:id="@+id/spinner_sales_store"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp" >

        <TextView
            android:id="@+id/textView2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/products"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <Spinner
            android:id="@+id/spinner_sales_product"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
    </TableRow>

    <TableRow
        android:id="@+id/tableRow3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp" >

        <TextView
            android:id="@+id/textView3"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/quantities"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <Spinner
            android:id="@+id/spinner_sales_quantity"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1" /> …
Run Code Online (Sandbox Code Playgroud)

xml android datepicker android-widget android-layout

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