小编Pal*_*avi的帖子

如何在Android中使用Tesseract?

我在网上搜了几个小时.我得到了许多答案,说我们需要使用NDK等来为WINDOWS的"Tesseract".

但是我没有逐步/正确地解释安装NDK时应该做什么.如何获取.so文件?我已经完成安装NDK和Cygwin.为了检查它是否正确完成,我输入make -v并给出了预期的输出.

任何使用过"Tesseract"的人都可以告诉我他们是如何做到的吗?(我已下载"Mezzofanti",但在那里我没有找到任何"Tesseract"文件.)

ocr android tesseract android-ndk

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

是否有可能从Android中的另一个应用程序获取数据?

我从android市场下载了一个应用程序.我只需输入一个数字,然后点击Enter,该应用程序生成一个包含一些内容的表.

我希望我的应用程序复制表的内容.我的应用程序调用了该应用程序 用户必须手动将数据放入编辑文本中,然后按Enter键.我的应用程序将在后台运行.

  1. 这可能吗?
  2. 怎么样?

另一个问题:我可以截取第二个应用程序屏幕的截图,然后使用图像到文本解码器来获取该屏幕上的数据吗?

android

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

新行字符的模糊行为

我正在将一个大字符串上传到web服务.该字符串包含新行字符,写为"\n".数据看起来像是:

 05/06/2012 11:35:43 AM- DB exists, transferring data\n05/06/2012
 11:48:20 AM- loadUserSpinners, cursor.getCount()=2\n05/06/2012
 11:48:20 AM- Battery: 50%\n05/06/2012 11:48:20 AM- ITEM SELECTED: 0
Run Code Online (Sandbox Code Playgroud)

以上数据存储在字符串中JsonArrObj.要上传数据/字符串,我使用以下代码:

    HttpParams httpParameters = new BasicHttpParams();
    int timeoutConnection = 360000; //6 minutes
    HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
    int timeoutSocket = 420000; //7 minutes
    HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
    HttpClient httpClient = new DefaultHttpClient(httpParameters);

    JSONArray jsonParams = new JSONArray();
    Object[] params={IPAddress,Database,DbName,DbPassword,JsonArrObj};
    for (int i = 0; i < params.length; i++) {
        jsonParams.put(params[i]);
    }

    JSONObject jsonRequest = new JSONObject();
    jsonRequest.put("id", Id);
    jsonRequest.put("method", FunctionName);
    jsonRequest.put("params", jsonParams); …
Run Code Online (Sandbox Code Playgroud)

android newline

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

如何获取表行/表项的单击事件?

我在.xml文件中有一个简单的表格布局.我在运行时向它添加组件.以下是我的代码:

public class Home extends Activity{

    TextView tv1; int i;TableRow tbrow;
    String [] names = {"First Name","Last Name", "Title","Company","Phone"};
    int [] images = { R.drawable.icon,R.drawable.icon,R.drawable.star2,R.drawable.icon,R.drawable.icon}


        @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); 
        setContentView(R.layout.main);      
        TableLayout ll=(TableLayout) findViewById(R.id.tableLayout1);


        TableRow trow=new TableRow(this);
        ImageView Image1=new ImageView(this);
        ImageView Image2=new ImageView(this);
        ImageView Image3=new ImageView(this);
        ImageView Image4=new ImageView(this);
        tv1=new TextView(this);
        trow.setClickable(true);

        Image1.setImageResource(R.drawable.blank);
        Image2.setImageResource(R.drawable.star2);
        Image3.setImageResource(R.drawable.blank);
        Image4.setImageResource(R.drawable.blank);

        tv1.setText("Brochures");
        trow.addView(Image1);
        trow.addView(tv1);
        trow.addView(Image2);
        trow.addView(Image3);
        trow.addView(Image4);
        trow.setId(0);
        ll.addView(trow);
        for(i=1;i<5;i++){
            tbrow=new TableRow(this);
            ImageView img1=new ImageView(this);
            tv1=new TextView(this);
            CheckBox chk=new CheckBox(this);
            ImageView img2=new ImageView(this); …
Run Code Online (Sandbox Code Playgroud)

android row android-tablelayout

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

在不退出应用程序的情况下停止执行函数

以下是我的代码:

try 
{
    usrID=client.callString("VerifyUsrnameAndPswd", userName.getText().toString(), password.getText().toString());
}
catch (JSONRPCException e)
{
    Toast.makeText(this, "No internet connection", Toast.LENGTH_LONG).show();           
    Log.e("error", "client.callString exception: "+e.toString());
    e.printStackTrace();
// If this condition is true, then no need to go ahead
}
// some steps of remaining code
Run Code Online (Sandbox Code Playgroud)

当没有互联网连接时,我不想执行catch块之后的步骤.但我甚至不想退出应用程序.因此无法使用final().

请建议我一些功能,以在不退出应用程序的情况下停止进一步执行.

android

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