1. Download our Official Android App: Forums for Android!

Apps Beginning Android Programming Question

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

  1. Garrowolf

    Garrowolf Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    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?
     

    Advertisement

  2. Thom

    Thom  
    VIP Member
    Rank:
    None
    Points:
    1,618
    Posts:
    12,114
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    12,114
    5,021
    1,618
    Male
    Software Developer
    Keene, NH USA
    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
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    okay thanks
     
  4. Thom

    Thom  
    VIP Member
    Rank:
    None
    Points:
    1,618
    Posts:
    12,114
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    12,114
    5,021
    1,618
    Male
    Software Developer
    Keene, NH USA
    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. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    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
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    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
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    I mean would that just be an xml file and some code for buttons?
     
  8. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
  9. Garrowolf

    Garrowolf Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    The problem is that I have gone through several starting android websites but I can't find this answer. They skip over it.
     
  10. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    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.
     
  11. Garrowolf

    Garrowolf Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    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.
     
  12. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    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)
     
  13. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    Oh and I would forget about HTML. I know it's ubiquitous these days, but it still can't be used for everything :)
     
  14. Garrowolf

    Garrowolf Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    So you won't help me out beyond go learn it for yourself?
     
  15. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator
    Rank:
     #33
    Points:
    633
    Posts:
    4,579
    Joined:
    May 2, 2012

    May 2, 2012
    4,579
    3,498
    633
    Male
    Student
    USA
    LV426 likes this.
  16. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    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.
  17. Garrowolf

    Garrowolf Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male
    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.
     
  18. LV426

    LV426 I say we take off and nuke this place from orbit
    Recognized Developer
    Rank:
     #12
    Points:
    1,988
    Posts:
    9,176
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    9,176
    13,681
    1,988
    Male
    Software developer
    South West of England
    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.
  19. Garrowolf

    Garrowolf Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    9
    Joined:
    Mar 5, 2016

    Mar 5, 2016
    9
    0
    15
    Male

Share This Page

Loading...