Monday, September 29, 2014

Image Buttons

  • Finn told me that image buttons have different formats which are -hdpi, -ldpi, -mdpi, -xhdpi, -xxhdpi 
    • As far as I know different devices have different file formats and xxhdpi is the highest quality image and hdpi is the lowest quality 
    • I think I found a resizer that will handle it automatically
  •  You can then upload the files and reference them from the drawable folder
  • You can also add different states to the buttons such as when it is clicked it can change the button or when there is a cursor over it
  • Finn told me how to move the images into the resources folder so tomorrow I can start applying the images to different buttons and adding different states to them
 -Aki

Goals:
  • Switch buttons to image buttons
  • Finn will suggest something else for me later in the week
  • Set up SQL database and start saving and loading things to it
  • Work on chat colors and user tags

Friday, September 26, 2014

SQL Connections! Servers!

I worked more on the server code today, and I did a ton! I got the following coded, although I haven't had the time to test any of it yet.

  • Setup a properties file, server.properties, which contains essential server information such as SQL information, etc.
  • Setup a full connection to an SQL server - via Java's SQLConnection
  • Once server connects to SQL, server will announce it has connected to IP:Port, and list the username, and the password in * form based on the amount of characters (so, if your password is password, it will be ********)
  • Setup methods ready to handle user permissions
  • Server will create a permissions file if it doesn't exist - this is another layer of security. With a permissions file, we define the mySQL information, so it isn't hardcoded. It also allows us to switch mySQL servers more easily to test, etc.
  • Client can now send data to server, and from there the server will handle all SQL, adding an extra security layer - this is done via a Java Socket, a DataInputStream, and the "case" and "switch" statements
  • Methods will also be made for specific actions, rather than directly putting in statements. This way the server can call things such as "setUserPermission", etc, rather than directly putting in SQL code. That way, no one can drop tables, etc.
Aki began to work on ImageButtons for all of our buttons. Default android buttons don't even compare to how these look, and the UI will look great! He's also coding them in as ImageButtons, rather than stock Buttons, which have a very default-android look.

As for some of our new buttons... many of our Menu buttons look like this. We're trying to give more of a pixel-art feel.


Thursday, September 25, 2014

Server and Client Updates + More!

Today I worked on modifying the server program. I added a DataOutputStream to both server and client side, and in the server, I added cases as well as some byte data sent by the client and read by the server, so now the server handles sending the complete message back to the client. It's a bit complex, but basically now I can have the server handle SQL connections without having to worry about database issues, etc.

Wednesday, September 24, 2014

My First App Continued

  • Finn fixed the problems with imports
  • There was a problem with the dimensions with the code they told me to paste so I just made up my own dimensions that seem to work
  • I also couldn't get the app to run on my phone so I'll try to figure that out later
  • The next app involves a maze so they had an animation that taught an algorithm of how to build a maze
  • The enum datatype is used for constant values so in the case of the maze you have the values EAST, WEST, NORTH, and SOUTH which never change



Finn Edit: I worked with DataOutputStreams and fixed some bugs in the code. Nothing big, still working on it, but hopefully I might be able to get server authentication with a user database working soon.

Tuesday, September 23, 2014

Chat Colors

Today I tried to implement ChatColors, but it's definitely a work in progress. I hope to possibly start it tomorrow (today I researched it). I found out that it's going to need to be serverside, and I'm going to have to use substrings to figure out if there's a chat color in the text and then change the text sent back to the client from there.

Aki worked more on EIMACS and figuring out how to make his first app. I fixed some issues he had in IntelliJ.

Monday, September 22, 2014

Eimacs: My First App

Today I worked on the eimacs curriculum but I am a bit slow at it because the tutorials are for NetBeans and Eclipse while I am using IntelliJ.



Notes
  • Activity: A screen(menu, settings) of the app where the user can make actions like press buttons or swipe (quit, change volume)
  • View: The class for widgets for the user to perform actions like buttons
  • ViewGroup: A subclass for View and the base class for layouts. It includes AbsoluteLayout, RelativeLayout, LinearLayout, and GridLayout for positioning widgets and such.
  • Method: From what it sounds like this is basically a function
  • Intent: These seem to tell the app what to do, like quit the app. You can also add FLAG like here "Intent.FLAG_ACTIVITY_NEW_TASK" to prioritize the Intent so, for instance, you would want a quit button to quit the app ASAP.
  • Class: Someone described it as blueprints where methods are placed and it can create different objects. So it was described as blueprints(class) for bikes(objects) where the different bikes had different features like gears,etc.
I skipped a section temporarily because the curriculum told me to use "Organize Imports" or "Fix Imports" to correct all the errors in the code they provided but it doesn't seem to be working in IntelliJ when I used "Optimize Imports". To answer your previous question, our reason for using custom image buttons is because the default buttons won't fit the art style of the game.

Finn Edit: I was sick today, but over the weekend I was able to get chat fully working with usernames. Now, it'll have a username in chat before the text, the username being found via SharedPreferences (it was saved back from the Account Creation screen!). I also fully finished the Music and SFX players (using the MediaPlayer object), so as soon as we have sounds, they can be easily played from any class that calls them!

I haven't checked with Aki yet, but this week my goals are to fully code all image buttons for the menu, have art done for all the buttons, and possibly start some UI coding for the game.

Friday, September 19, 2014

First Server! Chat!

Today after several hours I finally finished an entire server as well as a chat client on our app. Currently it still has some bugs (it needs to be able to receive other users' messages), but the server effectively receives all messages!

The server/client relationship is done via a Socket. There's not many new screenshots to post, however, since we haven't made any new layouts!

Thursday, September 18, 2014

Buttons

I used Finn's template to code a couple of buttons mainly in the new menus we added which was a log in screen and a server list although I actually forgot how to save the rendered images so I'll include the pictures in tomorrow's post when I figure it out.

EDIT: here are some pictures
The server list will use SQL to list servers when possible

Music Players and Image Buttons

Today I worked with the MediaPlayer class, and attempted to get background audio working, but I am still having issues with starting it. I'll finish it hopefully tomorrow.

Aki and I also worked on ImageButtons, but we're still clearing out issues with resizing the images to fill the buttons.

Tuesday, September 16, 2014

Custom Buttons, Menus, and More

Finn starting working on SQL and he also taught me a bit of Java and basic listeners(how to work a button).
final Button menuStore = (Button) findViewById(R.id.menuStore); //Button in menu to store
                    menuStore.setOnClickListener(new View.OnClickListener(){
                        public void onClick(View v){
                            Intent startStore = new Intent(v.getContext(), StoreHandler.class);
                            startActivity(startStore);

I can basically use this as a template for making buttons, all I have to do is change the IDs. I also added a store page but it's not that interesting.

I also started working on some custom UI and buttons last night. They are available here in a zip file (updated daily)! -Finn

Our goals for the week are
  • Make custom buttons 
  • Finish up most of the menus

Saturday, September 13, 2014

Reworking the Menu! + Optimization

Today I've started working on reworking the Menu code and optimizing it. I've removed several duplicate variables, etc. and I've also created a new Activity to handle the settings. In simpler words, an Activity is simply a second class, called to by the main class via an Intent. This allows you to keep multiple classes and simplify/organize your code better. In addition to this, I also got the Music sound bar working! It now also tracks progress.


I also worked a bit on making things look better. Now, before you change a sound setting, the text will be invisible (if you have already changed the sound in the app and gone back to the main menu, then returned again to the settings menu). It's a bit oddly specific and confusing, and I'm still trying to work out it being invisible until being changed.

However, as you change it, you will be able to see the percentage number to fine-tune it.

Other smaller changes:

  • The theme is now always Holo.NoActionBar.FullScreen - This means that the Android action bar / notification bar is never shown in-app unless you swipe downwards to see it (unlike previous screenshots)
  • The OK button in settings now promptly returns you to the menu!
  • The app now forces Landscape mode and will only be in Landscape mode (moving your device will not change it to Portrait mode).

Friday, September 12, 2014

Layouts, Seekbars, and Settings!

I worked on layouts for the settings menu which allowed me to position different widgets and text such as seekbars which act as volume bars. I have mainly been working on the UI as Finn works on coding the settings menu.
None of the widgets or buttons actually do anything right now but, for example, we hope to have those two "00" change when the user changes the volume. So 100 would be the max and 0 would be the least and OK would take you back to the main menu. As you can see the seekbar also defaults on 30 but that really doesn't matter right now. There are also a few problems like the seekbar is off center (Although, that may be only when you render it in IntelliJ) and we also don't know how to scale everything when you flip the device but we may just make it so that the game is always positioned horizontally.

Finn Edit: Tonight I worked on coding the seekbars. I was able to fully test everything, as I setup a second workspace so that I could debug with my Nexus 7. So far, after a very long and intensive coding session, I've gotten the SFX seek bar to correctly load data. Now, whenever you stop the app and restart it, it will remember your SFX setting! I also have coded the text to the right of the volume seekbar, so that it will now correctly store a number (the number of the percentage of the seekbar). I've attached an image to show this. Also, I plan to do the Music seekbar tomorrow. Since we now have a base for saving and loading preferences, we are now able to store any type of data, so finishing the settings and other features of the menu will be easy! As for the top with the app name, this is enabled via debug simply because I haven't bothered to change the theme (it is removed from the collaborative project!).

I am still considering re-working with GitHub. However, due to the extensive time and problems we ran into while setting up IntelliJ, I'm a bit hesitant to fool around with settings for awhile.


Thursday, September 11, 2014

Android Development

Today I messed around in a settings menu, I tried out the seek bar widget which could be used for a volume bar and I tried out the properties such as padding, width, and height. Finn started working on a file that saves settings. 

Wednesday, September 10, 2014

Rendering Problems

We were having rendering problems (it wasn't showing the virtual device so we couldn't make a layout for it) and this has set us back a lot so now we are going to try setting up eclipse to see if it is any better. We plan to use saros for real time editing. Otherwise if this doesn't work we will have to use our mobile devices to see any changes made.

Edit: Finn actually got IntelliJ working completely this time and he also started working on a menu which currently displays a disclaimer and a few buttons. Since Floobits is still working, we decided to keep using it!

Tuesday, September 9, 2014

Java Set Up 3

We just finished setting up the Android SDK on both computers and there were some problems with the path to the SDK but that is now fixed we also downloaded new API levels.


Also this looks neato https://www.kickstarter.com/projects/thoughtstem/codespells-express-yourself-with-magic

Monday, September 8, 2014

9/8/14


  • Fixed some issues with Floobits
  • Re-started with a new project
  • Finished GitHub integration! (Link goes to the repository)
  • Now working on fixing a new issue - We have to downgrade our version of the Android SDK, as IntelliJ is not compatible with the latest version of Android yet
  • Hopefully coding can start tomorrow! Our plans for this week are to get a basic layout and menu - we'll be working on an RPG-Based game, with a leveling system, upgrades, and hopefully some sort of random terrain generation... maybe servers, we'll see how far we can get, for Android (since most of the top apps currently lack... fun).
  • We also plan to have no in-app purchases and unlimited gameplay, since most apps also don't have that anymore.

Friday, September 5, 2014

9/5/14


  • Finished installing IntelliJ on both computers
  • IntelliJ, a Java IDE, is an alternative to more popular IDEs such as NetBeans and Eclipse. I personally chose IntelliJ to start this project because I wanted to experience things with a new IDE, as I have personally used Eclipse in the past and wanted to try something new!
  • I had to follow several steps to install IntelliJ on both computers. I started with the MacBook first, since I knew my way around it better (however I still am experienced with Linux! Mainly Ubuntu and CentOS, I've ran servers in the past so CentOS was an industry standard). The steps I followed for Mac are explained below.
    • Download the IntelliJ IDEA Community Edition Disk Image (.dmg file) from http://www.jetbrains.com/idea/download/
    • Open the Disk Image and run the installer
  • Although the Mac was relatively straightforward, I had to work a bit to get the IDE itself working on Linux. I followed similar steps, however some were a bit more complex.
    • Download the IntelliJ IDEA Community Edition Linux Package from http://www.jetbrains.com/idea/download/
    • Install the Linux Package via the dpkg command, shown below.
    • tar xfz idea-13.tar.gz
    • I then went into the IntelliJ directory, and ran the IDE, using the commands below.
    • cd Desktop
    • cd IntelliJ
    • cd bin
    • ./idea.sh
  • The IDE was now working on both computers! I then had to install Android SDK on both, which is where it got a bit more complex. However, beforehand, I knew I had to setup some form of realtime editing, so that we could both see each others' changes. I found this in a plugin called Floobits, which I found at https://floobits.com/. We both created accounts, and from there it was simple. I followed the following instructions to install Floobits on both computers.
    • Go to IntelliJ Settings (On Linux - File->Settings, On Mac IntelliJ->Preferences)
    • Select the Plugins menu
    • Select Install Plugin
    • Type in Floobits and install it
    • Restart IntelliJ and log into Floobits
  • On the Mac, I decided to host the project. I created a private project via Floobits and had Aki join it on his computer via IntelliJ's Quickstart menu. It was fairly simple, there was a "Join a friend's workspace" button.
  • We now had realtime editing! Next came Android SDK. I installed it on the Mac first. For the Mac, all you needed to do was download it from Google's Android Developer site and it was done. For Linux, I did the same thing, however I needed to link it to IntelliJ, via the Settings menu. I then doublechecked the Linux computer to make sure it had the right JDK and sadly it didn't. I installed that by going on Java's website, downloading the JDK, and installing it via the dpkg command.
  • We then both created GitHub accounts, and we're still working on linking GitHub to IntelliJ.

1st Day - 9/5/14

9/5/14


  • Began setup of IntelliJ on both computers
  • Began setup of Java JDK on both computers
  • Used sudo / dpkg commands to install on linux
  • Began setup of Android SDK on both computers