Topic: Programming Question?

Offline swindle

  • Hero Member
  • swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!
  • Posts: 12,699
Having a play with the Android SDK. Straight up don't know how to write code. Not even once.

But that aside, I wouldn't mind wasting a few hours figuring some things out. I'll learn what I need to right, but I have one question that I think would help fit some things together for me mentally.

Example: I want to build an app for www.reddit.com.

How do I go from an icon on the screen, to an app that is buttons showing all the current links etc?

I guess what I'm trying to get to in a stupid way here is - How do I import a website into an app that is interactive/current etc?

I have Eclipse/SDK and am finding tutorials on that. I just need a few simple explanations/breakdowns/directions to connect a few dots.

Posted: May 14, 2013, 09:57:23 pm
If we hit that bullseye, the rest of the dominoes should fall like a house of cards. Checkmate.

Offline mattnz

  • Hero Member
  • mattnz is working their way up.mattnz is working their way up.mattnz is working their way up.
  • Posts: 10,004
I certainly wouldn't start with an app like that. It's a non-trivial problem, and you're going to have to work with a HTML parsing library of some sort. That usually involves some basic data structures (loops etc.) that you should really know about before you try to code anything.

You could probably find some example code online, and maybe modify it slowly with trial and error into a Frankenstein monster program to do what you want, but chances are you'll need a reasonable amount of basic knowledge first.

Learning how to use the IDE (Integrated Development Environment, i.e. Eclipse) probably isn't as important as knowing the programming language, which I believe is Java-based in Android. Eclipse is pretty much at the top of the heap as far as IDEs go, and it's generally user-friendly.

So yeah, my recommendation would be to just find some Android programming tutorials, getting more specific towards HTML. To be fair, what you're wanting might be easier as a Firefox/Chrome addon, but that skill isn't as generalisable.

Reply #1 Posted: May 15, 2013, 11:30:36 am
Now that you have read this, plz give me neg rep :>

Offline Apostrophe Spacemonkey

  • Fuck this title in particular.

  • Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!
  • Posts: 19,050
Does the android SDK not have a web browser control which can just display html pages?

Reply #2 Posted: May 15, 2013, 11:34:20 am

Offline mattnz

  • Hero Member
  • mattnz is working their way up.mattnz is working their way up.mattnz is working their way up.
  • Posts: 10,004
Probably I guess, but if that's all he's after he may as well just bookmark a page using a web browser, mayn't he not?

Reply #3 Posted: May 15, 2013, 11:37:24 am
Now that you have read this, plz give me neg rep :>

Offline oefox

  • Devoted Member
  • oefox has no influence.
  • Posts: 1,186
I would recommend that if you really want to know the basics you should start by learning the basic semantics of programming http://en.wikipedia.org/wiki/Semantics_%28computer_science%29

Once you get that you should progress to playing around with a basic language such as lua which is used in minecraft http://www.lua.org/docs.html

Once you understand the basic semantics of programming, all languages are inherently easier to understand, much like learning a foreign language makes learning more easier.

I would recommend installing an IDE to help develop, such as eclipse http://www.eclipse.org/downloads/

Reply #4 Posted: May 15, 2013, 01:27:59 pm
- badfox

Offline Apostrophe Spacemonkey

  • Fuck this title in particular.

  • Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!
  • Posts: 19,050
C# and Java look quite the same. It's easy to pick one up when you already know the other.


Programming a simple C# Console program is a good start.
Code: [Select]
using System;
 
class Program
{
    static void Main()
    {
        Console.WriteLine("Hello world!");
    }
}
http://www.microsoft.com/visualstudio/eng/downloads#d-2010-express

Or a Java version of Ninja Attack.
Last Edit: May 15, 2013, 03:01:46 pm by Spacemonkey

Reply #5 Posted: May 15, 2013, 02:59:09 pm

Offline swindle

  • Hero Member
  • swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!
  • Posts: 12,699
Quote from: oefox;1525312
I would recommend installing an IDE to help develop, such as eclipse http://www.eclipse.org/downloads/


Yeah am using that.

Thanks guys. Info is brilliant.

Need to learn Java and HTML.

So I kill 2 birds with one stone here also in the sense that the Java/HTML code leant to deal with Android can also be transposed and used to create a web page?

Reply #6 Posted: May 15, 2013, 03:23:11 pm
If we hit that bullseye, the rest of the dominoes should fall like a house of cards. Checkmate.

Offline mattnz

  • Hero Member
  • mattnz is working their way up.mattnz is working their way up.mattnz is working their way up.
  • Posts: 10,004
Well Javascript and Java are different things, but you could use Java for an applet on a webpage I guess. Wouldn't work on most mobile platforms though.

Anyway, you might find it easier to go through some programming tutorials that are based on a particular language, it will be more concrete than reading abstract descriptions on wiki. Or maybe not.
Last Edit: May 15, 2013, 06:05:50 pm by mattnz

Reply #7 Posted: May 15, 2013, 03:32:17 pm
Now that you have read this, plz give me neg rep :>

Offline Bell

  • Addicted
  • Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.
  • Posts: 4,263
As Matt said the way I would do the task set out wouldn't be that trivial for a beginner.
It would be comprised of 3 major steps.

Crawling the webpage to download and parse the relevant HTML pages.
Processing the parsed data and creating a collection of custom UI objects.
Creating the front-end to handle user input and determine which objects to display.

My current project is somewhat similar, i'm creating a new website from a massive amount of raw HTML data downloaded from a government website.
So if you give this a crack I may be able to help a bit.
Last Edit: May 15, 2013, 06:53:16 pm by Bell

Reply #8 Posted: May 15, 2013, 06:47:45 pm

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
Quote from: mattnz;1525310
Probably I guess, but if that's all he's after he may as well just bookmark a page using a web browser, mayn't he not?


Over 90% of smartphone apps are just webpage portals.

Reply #9 Posted: May 15, 2013, 07:48:59 pm
Everyone needs more Bruce Campbell.

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
Quote from: oefox;1525312
I would recommend that if you really want to know the basics you should start by learning the basic semantics of programming http://en.wikipedia.org/wiki/Semantics_%28computer_science%29

Once you get that you should progress to playing around with a basic language such as lua which is used in minecraft http://www.lua.org/docs.html

Once you understand the basic semantics of programming, all languages are inherently easier to understand, much like learning a foreign language makes learning more easier.

I would recommend installing an IDE to help develop, such as eclipse http://www.eclipse.org/downloads/


A language like lua is a bad idea. Going from nothing straight to prototypal inheritance... :/
Also has a syntax that is unfamilar to curly brace C influenced languages like the one he'll need to write an android app.

He's going to be writing Java, so should just start with Java.

Reply #10 Posted: May 15, 2013, 07:55:52 pm
Everyone needs more Bruce Campbell.

Offline Bell

  • Addicted
  • Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.
  • Posts: 4,263
Yea lua was mind fuck enough coming from C++, although they threw an Occam framework at me at the same time. I wonder what it would be like going the other way.

Reply #11 Posted: May 15, 2013, 07:57:27 pm

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
Quote from: Bell;1525337
Yea lua was mind fuck enough coming from C++, although they threw an Occam framework at me at the same time. I wonder what it would be like going the other way.

I've often wondered what would happen if you taught someone to program in Javascript before going into class based paradigm. Would it be easier to switch over than it is to go the other way? I'm not sure. Prototypal inheritance is cool, but classes often bring strict typing with them, which could be a bit of a mind fuck to someone used to a much higher level. I think it would be easier, but I'm not too sure it'd be by much.

Lua is a mindfuck no matter where you're coming from I think.

Reply #12 Posted: May 15, 2013, 08:01:52 pm
Everyone needs more Bruce Campbell.

Offline swindle

  • Hero Member
  • swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!swindle is a rising star!
  • Posts: 12,699
Thanks again for the input guys.

Any reputable courses on coding one can take online? Beginners of beginners.

Reply #13 Posted: May 15, 2013, 09:03:00 pm
If we hit that bullseye, the rest of the dominoes should fall like a house of cards. Checkmate.

Offline Bell

  • Addicted
  • Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.
  • Posts: 4,263

Reply #14 Posted: May 15, 2013, 09:16:24 pm

Offline toofast

  • Addicted
  • toofast barely matters.toofast barely matters.
  • Posts: 3,697
Randomish question, but has anyone ever tried using c# via mono to develop for android vs. using java.  Because i find c# does have a good support base (especially for picking up the basics), and imo is a lot easier to just get going in. So i wonder if swindle will have better luck learning that/using that.

Reply #15 Posted: May 15, 2013, 10:53:01 pm

Offline Apostrophe Spacemonkey

  • Fuck this title in particular.

  • Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!Apostrophe Spacemonkey is awe-inspiring!
  • Posts: 19,050
Quote from: toofast;1525355
Randomish question, but has anyone ever tried using c# via mono to develop for android vs. using java.  Because i find c# does have a good support base (especially for picking up the basics), and imo is a lot easier to just get going in. So i wonder if swindle will have better luck learning that/using that.

A little bit. If I wanted to develop for android, mono would be the path I would take.

Reply #16 Posted: May 16, 2013, 08:10:14 am

Offline oefox

  • Devoted Member
  • oefox has no influence.
  • Posts: 1,186
You guys missed my point about LUA. It was not about syntax but about semantics. Perhaps I should've mentioned basic, pascal, python, or any myriad of simple to learn and use languages.

Actually, something like ruby (on rails) would be handy with it's online interpreter training thingy.


EDIT: Here's the link http://railsforzombies.org/
Last Edit: May 16, 2013, 02:41:20 pm by oefox

Reply #17 Posted: May 16, 2013, 02:38:45 pm
- badfox

Offline Bell

  • Addicted
  • Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.
  • Posts: 4,263
I'm not sure we did the syntax is pretty straight forward, its the features of lua that can be confusing when coming from 'traditional' programming languages.
You generally need to learn how to deal with classes if you want to program anything and in lua classes don't really exist but you can still make them by prototype http://en.wikipedia.org/wiki/Prototype-based_programming.

Sure using lua to learn conditional statements, control statements and simple data structures would be useful but i'd put forward python as a better candidate since the syntax is simple and once you have learnt the basics moving on to OO programming would arguably be easier than it would if you were using lua.

Reply #18 Posted: May 16, 2013, 05:48:00 pm

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
I think it is you who missed our point.
Lua isn't simple to learn.

Reply #19 Posted: May 16, 2013, 06:38:39 pm
Everyone needs more Bruce Campbell.

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
god wtf it took more than 50 mins between typing and pushing post.
Any language has a simple syntax & is easy to learn if all you're doing is if/else, while and for.

Learning Java? Start with Java.
Last Edit: May 16, 2013, 06:44:35 pm by Pyromanik

Reply #20 Posted: May 16, 2013, 06:41:36 pm
Everyone needs more Bruce Campbell.

Offline Bell

  • Addicted
  • Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.
  • Posts: 4,263
Yea but learning python lists is a fuckload easier than learning to use vectors in C++.

Reply #21 Posted: May 16, 2013, 07:15:56 pm

Offline Evil Guy

  • Just settled in
  • Evil Guy has no influence.
  • Posts: 123
I love python, but I presume we're still on-topic, so wouldn't java be the first choice here?
Even though SL4A allow most pure python to be used on android, I was under the (possibly naive) impression that java is the first class citizen for android apps .

Reply #22 Posted: May 16, 2013, 07:43:30 pm

Offline Bell

  • Addicted
  • Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.Bell is on the verge of being accepted.
  • Posts: 4,263
True I sorta forgot about the original point of this discussion heh
So in conclusion start learning Java swindle. Then once you get a basic grasp move onto the Andriod Framework.

Reply #23 Posted: May 16, 2013, 07:48:36 pm

Offline Pyromanik

  • Hero Member
  • Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!Pyromanik is awe-inspiring!
  • Posts: 28,834
Quote from: Evil Guy;1525405
I love python, but I presume we're still on-topic, so wouldn't java be the first choice here?
Even though SL4A allow most pure python to be used on android, I was under the (possibly naive) impression that java is the first class citizen for android apps .

I was under same impression.
Although I know Qt works on Android (with limitations), so you could tippity tappity some C++ if you were really keen Bell :P

Reply #24 Posted: May 16, 2013, 11:32:12 pm
Everyone needs more Bruce Campbell.