How to Make Efficient Content Applications in Android?
Learn how to make efficient static content based apps.
Gourav Khunger
Everyone knows this! Android is one of the best OS out there. Every day, many people enter the world of Android coding. And yes, it is also very easy. This is one of the major reasons for the success of Android. People try to get their hands into Android, by starting out with basic apps, understanding activities, fragments, and Intents.

Then, they move on to something complex such as Lists, Arrays, different Views, Messaging, etc, expanding their knowledge of Android. Then they come upon the idea of making and publishing their own app. This is a general way, people tend to move into Android coding. And, it works well.
A good approach is to start with making a static content application that teaches others about a specific theme or content, i.e., A content application. This is also a good idea. And it is also famous as people download new apps to learn a particular thing. And, of course, this article is for you if you wish to make a static content based Android application.
A general outline of the thought process
If you also thought of making such an app, then I can tell, what most novice or even some intermediate Android coders would think. Suppose, your application is about learning HTML. You know HTML very well and want to share your knowledge. Then you started an app and here comes the thing.
You might have thought to make a Home page(activity, if you know) followed by a splash screen. There you would link other activities to the Home activity with buttons.
This implies that you are making different activities for each activity containing specific content that you want to show to the user!
And what that means is, if you give information about more than 100 HTML tag(approx.), you will end up making these many activities(plus About page, credits, etc)! This now makes sense that handling that number of activities is not worthy enough and we need to do something efficiently!
If we make 100+ activities and link them to the Home activity, the size of the app and load on the system would increase incredibly.
The solution
Don’t worry! I am here to solve your problem. Just follow me.
You can proceed to make your basic activities, including SplashScreen, HomePage, Contact, About, and Credits. These are the basic requirements for almost every kind of app. This makes your app feel special and worthy.
Then, don’t start making activities like hell, just make another Activity named Content(.java
or .kt
– your choice, this article will teach the steps in java). And don’t make other activities by their single name.
Now, what we are going to do is the dynamic viewing of static content! Doesn’t that seem interesting, lets dig into it.
What to do after that?
After that, include all the content/information just into the strings.xml
file. Since we want our content to be beautiful, let’s make use of basic HTML for it(later, I will show you how to render that text into TextView):
COPYCOPYCOPYCOPY
<resource>
...
<string name="tag_anchor"><![CDATA[
<h1>Anchor tag</h1>
<p>Anchor Tag is used to make hyperlinks. It links webpages.....</p>
...
]]></string>
<string name="tag_heading"><![CDATA[
<h1>Heading tags</h1>
<p>Heading tags enable us to enlarge text and make headings.....</p>
...
]]></string>
...
</resource>
Be sure to wrap the HTML in <
Related Articles