小编Ser*_*lby的帖子

无法启动cygpath

我是openCV的新手,我下载它以便在Eclipse Juno中使用它.

我有下载版本2.4.6,我已下载NDK版本R9,我正在使用Windows平台,但由于以下错误,仍然无法运行openCV的教程.我按照本文档中的步骤操作.

我试图改变构建路径部分的路径(C:\android-ndk\android-ndk-r9\ndk-build.cmd NDK_DEBUG=1)

[2013-10-29 18:06:56 - Unable to launch cygpath. Is Cygwin on the path?] java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, The system cannot find the file specified
[2013-10-29 18:07:12 - ManagerActivity] Manifest attribute 'minSdkVersion' is set to '@ANDROID_NATIVE_API_LEVEL@'. Integer is expected.
[2013-10-29 18:07:13 - package] Manifest attribute 'minSdkVersion' is set to '@ANDROID_SDK_VERSION@'. Integer is expected.
Run Code Online (Sandbox Code Playgroud)

java eclipse opencv android-ndk cygpath

5
推荐指数
1
解决办法
9176
查看次数

自定义 GridView 内存不足异常

我有一个自定义网格视图的代码,每次我尝试运行它时,它都会因OutOfMemoryException. 我想解决方案是调整数组中的图像大小...

主要活动代码

public class AndroidGridLayoutActivity extends Activity {

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.grid_layout);

            GridView gridView = (GridView) findViewById(R.id.grid_view);

            // Instance of ImageAdapter Class
            gridView.setAdapter(new ImageAdapter(this));

            /**
             * On Click event for Single Gridview Item
             * */
            gridView.setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View v,
                        int position, long id) {

                    // Sending image id to FullScreenActivity
                    Intent i = new Intent(getApplicationContext(), FullImageActivity.class);
                    // passing array index
                    i.putExtra("id", position);
                    startActivity(i);
                }
            });
        } …
Run Code Online (Sandbox Code Playgroud)

android custom-adapter

5
推荐指数
1
解决办法
4633
查看次数

如何将数据从android Activity发送到java类?

我正在做一个简单的应用程序,从那里获取数据editText然后它获取该文本并发送到java类(在类我需要它将字符串转换为utf8编码).如何从活动中发送数据以及如何在java类中接收数据?

这是我的UTFencoder类:

public class UTFencoder {

public void main(String[] args) {

      String testString = encodeStringToUTF8("this is my app ... eskadenia");
      System.out.println(testString);
}

public static String encodeStringToUTF8(String stringToEncode) {
    String newValue = "";
    List<String> charactersCode = new ArrayList<String>();
    try {
        byte[] stringBytes = stringToEncode.getBytes("UTF-8");
        for (int i = 0; i < stringBytes.length; i++) {
            //System.out.println("utf value is " + stringBytes[i]);
            String value = String.valueOf(stringBytes[i]);

            int no = Integer.parseInt(value);
            String hex = Integer.toHexString(no);
            //System.out.println("Hex value is " + hex);
            for …
Run Code Online (Sandbox Code Playgroud)

java android class android-activity

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