English 中文(简体)
氯乙烯
原标题:Lucene in Android

I m new to android and Lucene. can I use Lucene for search in android list view. I have tried importing the package 2.3.2 and also used the jar files in library. However, there is an error in SearchFiles.java error is :
The type java.rmi.Remote cannot be resolved. It is indirectly referenced from .class files.

There is a possibility that this file doesnt exist for android. Is this the problem?

问题回答

http://en.wikipedia.org/wiki/Full_text_search”rel=“noretinger”>Full Text Pur/a> 专题称为,

我已成功使用Lucene 3.3进行真正简单的搜索,并投入工作。 然而,我不知道记忆使用的影响是什么。 在3.3项中,没有来自马绍尔群岛共和国。 如果你需要2.3.2,而且你有源代码,你可以免除卢塞尼对马绍尔群岛的依赖(我看一看一个成功这样做的gu)。

  1. Delete "extends java.rmi.Remote" from the Class "org.apache.lucene.search.Searchable"
  2. Delete class "org.apache.lucene.search.RemoteSearchable"

Android is not java - it does not provide all standart java apis ( just look into android reference, java.rmi is not there ). However, it is possible to import almost everrything that is pure java ( if you have enough memory ). You may try to remove unnecessary classes which cause classloading problems from jars - bu it is a lot of work.

This repository modify Lucene 7.3.0 for using in Android 8.0: https://github.com/texophen/lucene-android

如不工作,可修改org.apache.lucene.util.Attribute 2. 工厂和添加种类以替代方法:

  static final MethodHandle findAttributeImplCtor(Class<? extends AttributeImpl> clazz) {
    try {
      //org.apache.lucene.LucenePackage.writeLog("AttributeFactory.findAttributeImplCtor() - 1: " + lookup.findConstructor(clazz, NO_ARG_CTOR).toString());
      MethodHandle mh = null;
      if (lookup.findConstructor(clazz, NO_ARG_CTOR).toString().endsWith("PackedTokenAttributeImpl")) {
        mh = lookup.findConstructor(clazz, NO_ARG_CTOR).asType(MethodType.methodType(org.apache.lucene.analysis.tokenattributes.PackedTokenAttributeImpl.class));
      } else {
        mh = lookup.findConstructor(clazz, NO_ARG_CTOR).asType(NO_ARG_RETURNING_ATTRIBUTEIMPL);
      }
      //org.apache.lucene.LucenePackage.writeLog("AttributeFactory.findAttributeImplCtor() - 2: " + mh.toString());
      return mh;
    } catch (NoSuchMethodException | IllegalAccessException e) {
      throw new IllegalArgumentException("Cannot lookup accessible no-arg constructor for: " + clazz.getName(), e);
    }
  }




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签