7

Suppose I want to render/present a text transmitted in the form of some lightweight markup language. Are there any ready-to-use libraries for Android, which take as input text in a lightweight markup language and present it nicely? When I say lightweight markup language, I mean Markdown (http://en.wikipedia.org/wiki/Markdown) or something similar.

subodh
  • 6,136
  • 12
  • 51
  • 73
Karen Tamrazyan
  • 157
  • 2
  • 12

3 Answers3

7

There's also AndDown, an Android wrapper around the C-based parser sundown:

By using the NDK with this C library, parsing speeds are nice and fast -- 5K of input can be converted into HTML in about 1 millisecond. Also, sundown is a fairly popular Markdown processor and is the brains behind GitHub-flavored Markdown.

miek
  • 3,446
  • 2
  • 29
  • 31
3

You can look at:

MarkdownJ

I haven't tried this.

JMD

This works, but the latest build has issues with some numbers in the text being interpreted as entities; e.g. "The 39th President" becomes "The &39;th President".

PegDown

This works properly, but in the rather old 0.8.0.1 version I am currently using it's really surprisingly CPU intensive(*) - much more so that JMD. It's dependent on the separate parboiled PEG parser (which also has a newer version than I am currently using). (Stricken based on comment below)

(*) The excessive CPU load seems to only occur on the IBM Classic JVM for the AS/400.


NOTE: I have used these only on Java VMs, not on Android, but I know of no reason why any or all of them should not work on Android.

Lawrence Dol
  • 63,018
  • 25
  • 139
  • 189
  • 3
    Actually, PegDown will not work -- I just tried it. It attempts to generate classes on the fly, which will not work without a Dalvik-specific implementation. – CommonsWare Dec 05 '10 at 22:15
1

You can also check markdown4j, which is a lightweight java library (and can be used in Android).

Plato
  • 2,338
  • 18
  • 21