Jump to content

  • Log In with Google      Sign In   
  • Create Account


TimA

Member Since 18 Mar 2012
Offline Last Active Dec 25 2013 01:03 PM

#5116842 Android Development - More Java, Less hand-holding

Posted by TimA on 14 December 2013 - 05:11 AM

Okay....I really dislike the whole Eclipse with ADT set-up.  Drag and drop stuff onto a graphical representation of a phone/tablet, figure out where the code goes....not for me.  I'd rather just write everything by hand.  Is there any way to write Android apps without having that rediculous set-up?

 

Android apps are written in Java...great I thought, I already know Java.  But the Eclipse/ADT set-up looks rediculous to me.  I'd rather just know where the program entry point is, import/create the necessary files, hand-code the UI using the API and compile to an apk.

 

I'll admit I haven't messed around with it a whole lot...because I want to write code....not drag things onto the screen and set their properties. 

 

I like Eclipse for regular PC applications.  You create the main class, give it a main() and you're good to go.  You want a GUI....import swing, set up the window with Frames and the like and you're good to go.  Took me an hour to understand that and a week to master (I'll fully admit I'm no Swing expert...but I can get a UI looking and behaving the way I want).  Android development....not as easy...at least not to me. 

 

I feel like I have to not only learn the Android API, but also how to use Eclipse/ADT's goofy interface.  It also doesn't really outline a clear code-path.  I assume most apps are event-driven so there wouldn't be a clear code-path - but still, I'd rather know how all that fits together and have the code arranged in a way that makes sense to me for a particular project. 

 

All I want to do is write a calendar app thats tailored to keeping track of my homework.  I have the entire design of this app already worked out in my head.  On a computer It'd take me at most 2 days to program it, and another day or 2 to debug and flesh out any major bugs.  A great starting app for android I thought - Simplistic, useful, and a perfect use of my free time between semesters.  I don't even know where to begin.  Normally I'd start writing the classes for everything, then design the UI, and then attach the UI to the underlying objects.  I can't even figure out how to get things to orient themselves the way I want.  I'd rather just write code that says create a textbox, position it this way (ie. LayoutManager), set this property to this, etc. 

 

Is there anyway to create an android app strictly from writing code? No drag and drop, no running through 100's of files to find the one that holds the code for the one thing I want to write.  Just pure code. 

 

Android is built on Linux, is all about open-source, a hacker/tinkerer's dream - not to mention all the cool sh*t inside the devices...like the accelerometer, HD camera, NFC, bluetooth, Wi-Fi....I guess I was expecting power tools, not fisher-price. 

 

Can anyone link me to some tutorials that show how to write Android apps independent of an IDE.  I'd much rather write the XML files by hand and compile by command-line than figure out how to use a UI that looks like it was designed for a spastic toddler.  I'm starting to realize just why the Google Play store is plagued with moustache-trimming games and fake broken screen apps.  It's really frustrating.

 

Thanks in advance to anyone that can point me in the right direction.

 

PS - I prefer textual information over videos, but I'll take whatever I can get.




#5041566 How Do I Make a Level Editor

Posted by TimA on 10 March 2013 - 12:07 PM

A level editor is just a program that creates files.  How it does this is totally up to you.  You pick what data is necessary to save from the map (images to load, positions of objects, etc.).  You either have your level editor save this as plain text, or you save it as binary (raw bytes).

 

Your game will have a function for loading the map from a file.  How this function works will depend completely on how you wrote your save function (since it's effectively reversing it). 

 

If you're asking how to create the GUI for the level editor, then it depends.  You can use SDL, SFML, Allegro, or any other graphics library if you're up for creating a bunch of form elements (picture boxes, menus, textboxes, etc.)  I think SDL has some 3rd party add-ons that help with that, not 100% on that though, haven't used it in a while.  Last I knew, SDL was capable of loading PNG's through SDL_image.  (windows binaries should be pre-built with it, in linux I assume it would have it as long as it compiled succesfully and found an appropriate version of libpng). 

 

Another option would be to use something like FLTK (pronounced full-tick).  This is a library for creating GUI's and would probably make creating your level editor a lot quicker.

http://www.fltk.org/shots.php

 

As for tutorials...googling SDL tutorials dropped these as the first two links:

 

www.sdltutorials.com/
lazyfoo.net/SDL_tutorials/index.php
 
 
but it's always good to read the API:
 
So in short, what you want to learn:
SDL, SFML, Allegro (your game, maybe your level editor, research these libraries, pick the best one for what you're making)
C++ filestreams (loading and saving files)
GUI-creation (graphic user interface for your level editor)
How to use libraries (SDL is a library, FLTK is a library...libraries are your friend, learn to use them)
How to read and understand API manuals (A library could be the most amazing thing on earth, if it doesnt have good documentation its useless)
 
Or you could just use someone elses level editor and just have a function in your game that knows how to read their map files.
 

 




#5020771 Possible C++ scope issue with class and vector of pointers

Posted by TimA on 12 January 2013 - 11:44 AM

haha oooooh I see what I was doing now - thank you so much - is there anyway to initialize a vector in a class to a specific size in the constructor?  That's what I was trying to do, not create a local version of it.  Figured if I knew the starting size it'd be more efficient to create the vector to that size rather than using vector.push_back() to append a new element.  Do vectors allocate contiguous memory if initialized to size? I assume vectors can't do that when using push_back()? or maybe they re-create themselves after every added element so that it can fit into contiguous memory?




PARTNERS