MaxySpark
MaxySpark

Reputation: 565

How can show c and c++ code in android using textview with syntax highlighting?

I am new to android programming.

I want to create a android app to display some c++ code.

How can I add my c++ source code to a TextView and display it with syntaxt highlighting?

I did some search in google and found this in Android Syntax Highlighting? but I don't know how to add javapreetify file to android studio(1.5.1) build path.

Someone please help me.

or make a tutorial please

Upvotes: 0

Views: 1454

Answers (2)

inyee
inyee

Reputation: 445

select the text widgets -> go to properties -> put your c code in text

Upvotes: 0

snafu109
snafu109

Reputation: 592

I'd comment on your post but I don't have enough reputation yet...

There is some good information on this post here: Android Syntax Highlighting?, specifically this comment which has an exmaple for integrating Java Prettify with a TextView: https://stackoverflow.com/a/19787125/6786

Adding the JAR to the build file could be accomplished with these instructions: https://stackoverflow.com/a/16628496/6786

Upvotes: 2

Related Questions