1. Are you ready for the Galaxy S20? Here is everything we know so far!

Beginning Android Programming Question

Discussion in 'Android Development' started by Garrowolf, Mar 5, 2016.

  1. Garrowolf

    Garrowolf Lurker
    Thread Starter

    I am just starting with android programming and I find that I learn best by trying to do a simple project. I want to create an app that just displays pages offline. Basically it would be a series of pages and a few buttons. Eventually I want to make a larger app with a lot more pages but I want to start with something simple first.
    What do I need to be able to do this?
    Would each page be done in XML? HTML? How would this work?
     


  2. Welcome to Android Forums.

    This thread was moved to this forum that is dedicated to discussing development questions.

    ... Thom
     
  3. Garrowolf

    Garrowolf Lurker
    Thread Starter

    okay thanks
     
  4. Take a look at the other threads in this forum ... if you haven't already. I think you will find it to be a very good learning resource.

    ... Thom
     
  5. Deleted User

    Deleted User Guest

    When you say "pages" do you mean a web page?
    If so then you will need to make use of the Android WebView component

    http://developer.android.com/guide/webapps/webview.html

    Web pages are written in HTML, and are retrieved from a remote web server. There are a number of ways you can implement the server part of this (to generate the HTML). Probably the simplest way is to use a PHP script.
     
    Mikestony likes this.
  6. Garrowolf

    Garrowolf Lurker
    Thread Starter

    Yes like an html page but offline. What is the android app version of a static web page offline?
     
  7. Garrowolf

    Garrowolf Lurker
    Thread Starter

    I mean would that just be an xml file and some code for buttons?
     
  8. Garrowolf

    Garrowolf Lurker
    Thread Starter

    The problem is that I have gone through several starting android websites but I can't find this answer. They skip over it.
     
  9. Deleted User

    Deleted User Guest

    Skip over what? What is the "answer" you seek?

    If you want to create an Android app with a couple of buttons, that's easy.
    You need an XML file to create the layout, which specifies where your buttons are on the screen.
    You need code to handle the button clicks, and do something.

    What exactly do you want your app to do? That is your first problem, determining the function of your app.
     
  10. Garrowolf

    Garrowolf Lurker
    Thread Starter

    I'm talking about the text. Do I use an html file and call it from another file or do I have to embed all text in the xml now. I'm trying to create an education type app that just displays information offline.
     
  11. Deleted User

    Deleted User Guest

    Ok, your plan of action would be (not necessarily in this order):-

    1. Sketch out your screen layout design
    2. If you have multiple screens, how does the user navigate between them?
    3. Read a few Android tutorials and books
    4. Install the Android development tools
    5. Look at some of the sample applications and understand how they work
    6. Code up some simple apps (hello world)
    7. If you don't know Java, then learn this language (pre-requisite to most of the above)
     
  12. Deleted User

    Deleted User Guest

    Oh and I would forget about HTML. I know it's ubiquitous these days, but it still can't be used for everything :)
     
  13. Garrowolf

    Garrowolf Lurker
    Thread Starter

    So you won't help me out beyond go learn it for yourself?
     
  14. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator

    Deleted User likes this.
  15. Deleted User

    Deleted User Guest

    From what you've said so far, your question is so vague/broad. Questions like this are virtually unanswerable. Because you lack so much knowledge, where do I start? With a Java tutorial? With a basic Android 'hello world' tutorial? I could be here all night just putting together links to useful online tutorials, let alone actually typing stuff in for you to read exactly what to do.
    So you tell me, beyond the pointers which I've taken the time to give you so far (it's ok you're welcome), what information exactly do want me to spoon feed to you?

    In fact you said yourself in the first post that you learn best by trying simple things first. Well that's a great plan. Why don't you try it? You can't get much simpler than putting a couple of buttons on to a page. That's Android 101, and a good place to start.
     
    scary alien, Mikestony and Unforgiven like this.
  16. Garrowolf

    Garrowolf Lurker
    Thread Starter

    My question isn't vague at all. You are just not actually reading it. I am asking how the text part of an android app is handled. Do you store each paragraph as an element? I am confused about how you would deal with a lot of text. Could you take several html pages and convert it to another format to show up in the app?
    I am trying to learn how to make these but I have a different idea on what kinds of apps to make. A primarily text based app should be simple if I can get someone to answer a question or two - not do it for me. I may just not have the right terminology which is why my searches have come up useless or over my head.
     
  17. Deleted User

    Deleted User Guest

    So you want to display a block of text? You need to use a TextView
    http://developer.android.com/reference/android/widget/TextView.html

    You could potentially extract information from a HTML page in your app, e.g. the contents of a <p> or <div> element. Once you had the text content, you could then load it into a TextView.

    In fact I just found something called JSoup. It seems ideal for what you want, scraping information from a web page. Never used it myself, but here you go:

    http://www.androidbegin.com/tutorial/android-basic-jsoup-tutorial/
     
    scary alien likes this.
  18. Garrowolf

    Garrowolf Lurker
    Thread Starter

Loading...

Share This Page

Loading...