Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9217809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:42:58+00:00 2026-06-18T02:42:58+00:00

I am building an app that include the c++ programs. I just need to

  • 0

I am building an app that include the c++ programs. I just need to show the code as a text in my xml layout. I don’t want it to compile it or to do anything else with it. But every time i write the text it show error that you cant use strings like ‘<‘, ‘>’ or double inverted commas. Can you please help me out how i can use these strings in my text view.
Here is my xm layout.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<EditText
    android:id="@+id/program_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:inputType="textMultiLine"
    android:text="
       #include<iostream.h>
       #include<conio.h>
       void main()
       {
         int arr[n], i,j,n,temp;
         cout<<"How any elements you want to enter";
         cin>>n;
         cout<<"Enter array elements"
         for(i=0;i<n;i++)  
         cin>>a[i]
       }     " >

    <requestFocus />
</EditText>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T02:42:59+00:00Added an answer on June 18, 2026 at 2:42 am

    Take a look to my response in this question. You shouldn’t include literal strings in your XML layout. It is much more recommended to store C code in files in assets folder, so you don’t need to modify them at all (it’s a waste of time and a source of errors). Just inflate a WebView widget with all the C code enclosed in <pre>[text read from file]</pre> tags and you will be able to show it perfectly OK and take advantage of scrolling and zoom for free.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to include a feature on an app I'm building that allows the
I finished building an app that allows beaming of photos, contacts and text clips
I'm building an app using Brunch and Backbone.js that is to include nested menus.
Currently building an app that runs on mobile phones not related to the issue
I am building an app that performs a lot of client side data downloading
I am building an app that does a lot of math and calculations. I
So I'm building an app that needs to know the location of the Box
I'm building an app that allows users to view pictures off a website. I
I am building an app that plays multiple video files, But I would like
I am building an app that uses the fine Urban Airship api to send

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.