Setting up libGDX for Android Studio on Ubuntu

Every one else is probably brighter than me. However, after reading the instructions over and over again, and then attempting to follow them, it just wasn’t working. All I wanted to do was start a libGDX project in Android Studio. I finally figured out where I went wrong, so here is the step by step for any one else that gets stuck like I did. Please read all the instructions first, because step 5 becomes step 1, but doesn’t make sense unless you read them in this order:

  1. Go to https://libgdx.badlogicgames.com/download.html and click “Download Setup App”.
  2. A jar is downloaded. Don’t try to import it, or something of that nature. Clicking on it is no good either. Simply open a terminal window and cd to the Downloads directory. Once you are there, type: $ java -jar ./gdx-setup.jar
  3. A window will pop up. Fill in the usual blanks to name your app.
  4. For the Android SDK field, open Android Studio, and click File –> Project Structure. That first field is the Android SDK.
  5. For the folder to put the newly created app in, be sure that you choose a folder that is empty, because it will wipe out everything in that folder. So I recommend you make a folder for it first!
  6. Uncheck the things you don’t need, like IOS, HTML, etc, and click generate.
  7. Once it is done, go back to Android Studio, and click File –> open.
  8. Choose the folder you put it in, and Android Studio will recognize the gradle files in it, and open your new app!

Hopefully that makes sense and keeps you from wasting as much time as I did. Most of you are probabl smart enough to know this already!

Linux – keep it simple.

Overclocked the Verizon Galaxy S5

Actually, I’m not the first one to do this. It’s been done dozens of times before, and quite frankly, to higher levels. So, why do I make my own kernel overclocked? Well, I do think there is one difference in my kernel overclocking than the others. I don’t increase the voltage while adding faster processing power.

Typically, in my kernels I try to focus on battery over performance. However, I like getting the most bang for the buck, too. So, in my kernel, I increased the frequency by 3%, but did not increase the voltage any. This allows the maximum benefit for the same amount of voltage, which equals an increase in performance, without an extra drain on the battery.

Okay, at least not a noticeable drain on the battery. Ohms law is still true, so the Resistance will drop slightly as the frequency went up, because of slightly higher heat, microscopically decreasing the resistance and changing the formula. However, when you increase the voltage, the Power formula changes dramatically.

For example, some fictitious numbers for conceptualization:

Power = Current x Voltage Let’s say, (P) 12 = (I) 2 x (E) 6.

If we increase the Voltage, the change is drastic: (P) 14 = (I) 2 x (E) 7.

If we don’t increase the voltage, the change is microscopic, only because the change in frequency will ultimately increase the heat (very slightly). In ohm’s law, that is I=E/R, so our formula looks like this: Power = Voltage/Resistance x Voltage, or (P) 12 = ([E] 6 / [R] 3) x (E) 6. So if the heat rises microscopically, then the semiconductor resistance lowers microscopically*, then the power will only change microscopically. So, our new fictitious formula looks like this: (P) 12.04 = ([E] 6 / [R] 2.99) x (E) 6.

Either way, you can check out the commit here:

https://github.com/alaskalinuxuser/android_kernel_samsung_klte/commit/dd3e95708f0f4166486fc4341691826ea303d993

Linux – keep it simple.

*Normally, in wire, heat increases cause the resistance to increase. However:

“In a semi-conductor, there is an energy gap between the (filled) valence and the (empty) conduction band. At zero temperature, no charges are in the conduction band and the resistance should be infinite as the system behaves basically like an insulator. If you turn on the temperature, some electrons will start to occupy the conduction band and thus contribute to conduction, lowering the [resistance].”  https://physics.stackexchange.com/users/661/lagerbaer

 

CPU and GPU voltage control are back!

CPU and GPU voltage control are back! To God be the glory!

Since moving to Android Nougat, I have not been able to make GPU and CPU voltage control work for the Samsung Galaxy S4, but that changed today. You can see the commit here:

https://github.com/alaskalinuxuser/android_kernel_samsung_jf/commit/9544cab218a4348563067588b8b607d6e9d7ab11

Finally the end user has the ability to control the CPU and GPU voltage with apps like Kernel Adiutor and my GPU Voltage Control App.

You can find my GPU voltage control app here:

https://forum.xda-developers.com/galaxy-s4-tmobile/themes-apps/app-gpu-voltage-control-app-aklu-kernels-t3506985

Remember, changing your CPU or GPU voltages is dangerous. Don’t make drastic changes, and be careful!

Linux – keep it simple.

POWER_HINT_LAUNCH_BOOST is not declared in this scope!

While building AOKP 7.1.2 for the kltevwz (the Verizon Samsung Galaxy S5), I ran into this error:

[CODE]

device/qcom/common/power/power-8974.c:143:17: error: ‘POWER_HINT_LAUNCH_BOOST’ was not declared in this scope …….Edited for space…….. make: *** Waiting for unfinished jobs….

[/CODE]

So, I headed over to device/qcom/common/power/power-8974.c, and this is what I saw:

[CODE]

if (hint == POWER_HINT_LAUNCH_BOOST) {
int duration = 2000;
int resources[] = { CPUS_ONLINE_MIN_3,
CPU0_MIN_FREQ_TURBO_MAX, CPU1_MIN_FREQ_TURBO_MAX,
CPU2_MIN_FREQ_TURBO_MAX, CPU3_MIN_FREQ_TURBO_MAX };

interaction(duration, ARRAY_SIZE(resources), resources);

return HINT_HANDLED;
}

[/CODE]

Looked pretty normal to me. However, when comparing to LineageOS’s 14.1 files, I saw that they dropped the “boost” from the name of the hint. So I edited mine to match, like so:

[CODE]

if (hint == POWER_HINT_LAUNCH) {
int duration = 2000;
int resources[] = { CPUS_ONLINE_MIN_3,
CPU0_MIN_FREQ_TURBO_MAX, CPU1_MIN_FREQ_TURBO_MAX,
CPU2_MIN_FREQ_TURBO_MAX, CPU3_MIN_FREQ_TURBO_MAX };

interaction(duration, ARRAY_SIZE(resources), resources);

return HINT_HANDLED;
}

[/CODE]

And, it built that part successfully! I like the easy problems!

Linux – keep it simple.

Just letting the user know…

When making apps, I have begun to realize that I don’t do a very good job of creating intuitive and informative interfaces. The fact that the user his the export button doesn’t really tell the Just Notes app user that they actually did anything, or that notes were exported. That is why I added this commit:

https://github.com/alaskalinuxuser/app_justnotes/commit/9162b2bb87c46574765ced7b4a7f9b8ff223756f

Essentially, I created a pop up (called a toast) that tells the user their notes were, in fact, exported. Something I probably should have done a long time ago!

Linux – keep it simple.

Critical Velocity! A fun side scrolling arcade style game.

After finishing my Android developer course, I decided to try to put my new found (fledgling) skills to use by making a game. It’s a classic side scroller with an arcade feel to it. The story line is pretty short and to the point: you are a captain of a space ship that must escape a tunnel buried beneath the surface of a collapsing planet.

As you pass each object in the tunnel, you gain speed. There are power ups and bonus points, all the usual suspects in arcade game play, so be sure to check it out in my “Homemade Apps” section, on the play store, or in my github (it is licensed under the Apache 2.0 open source license.)

The background for the game was provided by the Quiet Learner ( https://qlfiles.net/ ), the music is “Space Blockbuster” by Soulbringer ( http://freemusicarchive.org/music/Soulbringer/Soulbringer/Soulbringer_-_Space_Blockbuster ), and the graphics were modified from Dan Cook’s work which he released to the public ( http://www.lostgarden.com/2005/03/game-post-mortem-hard-vacuum.html ). It’s great when people share their work so others can build upon it or with it. The same applies for my work on this game, if you can use it, do!

Linux – keep it simple.

Adding Parse to your App in Android Studio

Parse is a really neat tool for your Android applications, allowing you to have online servers that store game scores, driver id’s, names, logins, you name it! Whatever storage your app needs, you can just about always use parse for the job.

The usual way of getting parse set up in your app used to be downloading the latest parse “starter kit” app. An empty app that has parse libraries and the code needed already built in. But that is a bit of a hassle now, since they have closed down the parse website.

However, as I mentioned before, parse did make all of their material open source as they faded off into the wild blue yonder, but it left newbies like myself struggling to figure out how to implement parse into new apps.

The great news is, you do not need to get a “parse starter kit” or some such app. The pros already had this figured out, but if you are new like me, then here is my take on importing parse into your app in Android Studio (this should work on any Android Studio, but for reference, I used Android Studio 2.3.1).

Step 1. Make a new app, name it whatever you want.

Step 2. From the file menu, click “project structure”.

addparse1

Step 3. In the window that pops up, under Modules, click “app”.

addparse2

Step 4. Click on the “Dependencies” tab.

addparse3

Step 5. Click the green “+” arrow, and choose #1, Library.

addparse4

Step 6. When the Library Dependency window opens, type “parse” and press enter. Now choose the latest “com.parse:parse-android XXXXXXXXXX” version, and press OK.

addparse5

Step 7. You should now be returned to your Dependencies tab, with the parse library added. Press OK to close the window.

addparse6

Step 8. Add these lines to your MainActivity.java file (Or whatever you chose to call the first launched activity) :

// Enable Local Datastore.
Parse.enableLocalDatastore(this);

// Add your initialization code here
Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
        .applicationId("ENTERYOURINFOHERE")
        .clientKey("ENTERYOURINFOHERE")
        .server("https://ENTERYOURINFOHERE/parse/")
        .build()
);

I put that data into the “onCreate” method, so it is called as soon as you launch the app. Now you just have to fill it in with your app id, key, and url for your parse server, and you should be good to go! Then you can start adding your parse commands as usual.

I hope that helps some other parse/app making newbie like myself!

Linux – keep it simple.

 

Sometimes the screen is just too small….

Recently I updated my Ships, Captain, and Crew game, because of a comment from a friend. They wanted to know where to find the instructions on how to play the game.

Of course, I told them the instructions are on the “about” page. They looked and couldn’t find them. After looking at their phone, I realized that the screen, though large, was a lower resolution, and the information I wanted displayed was off of the bottom of the screen.

App making is a lot more tedious than I thought.

When you are unsure if information will be off of the screen, there are several options to choose from, like making everything smaller, or using constraint layouts, or even scroll views. I just wanted to leave a note for the wise to check that their information is properly being displayed on different devices. Just because it looked good on the Android emulator doesn’t mean that it actually displays on every one’s real screen.

Linux – keep it simple.

All about parse!

As many of you probably already know, the parse server service was shut down some time ago. However, on the way out the door, they released all of their material as open source for the community at large to benefit from. This is great for open source junkies like me, but also is an incredible resource for Android app developers, who can deploy these parse servers to places like Heroku, or self host the services, either locally or over the internet.

As part of my Android app developer course, I had to do several exercises with parse servers and app integration, so I committed my parse work to my github with this commit:

https://github.com/alaskalinuxuser/apps_small/commit/9e746535ab4f6b869d4c02517f50f6c4d08eae64

Or you can go to my “all things parse” folder by clicking this link:

https://github.com/alaskalinuxuser/apps_small/tree/master/EverythingParsePossible

The folder contains an app that I made with many parse options and examples in it. Contrary to the name, there are actually a lot of other parse options, too, but this will definitely get you started!

Linux – keep it simple.

Samsung Galaxy S5 kernels

Below are some kernels for the Samsung Galaxy S5. You can find the source code here:

https://github.com/alaskalinuxuser

Praise God! The AKLU kernel has arrived on the Galaxy S5 in the flavor of NOUGAT!

Here is the latest download for AOKP Nougat, it may work on CM, PAC, or RR:

http://www.mediafire.com/file/iwwcjaw6ab96rv3/AKLU-KLTE-AOKP-N-20170530.zip

Change log:

+ Added KTOONSEZ Voltage control!
– Can be controlled from Kernel Adiutor or other apps. WARNING! THIS IS DANGEROUS!

20170524
+ Overclocked CPU from 2457 MHz to 2533 MHz
– A 3% gain without increasing voltage!

20170518
+ Added Governors:
– SmartMax
– Wheatley
– LionHeart
– Already had: Powersave, Interactive, Conservative, Ondemand, Userspace.

Enjoy!

Linux – keep it simple.