Showing posts with label studio. Show all posts
Showing posts with label studio. Show all posts

2014-12-05

Level Up - Android Studio: How to Boost Productivity By Auto-Generating Getters and Setters

A best practice in Java is to encapsulate field variables by making them private and creating a "getter" and "setter" for each of them, as needed. Doing this with many fields can be a lot of boilerplate code to write. But, thankfully, modern IDEs, like Android Studio provide ways to auto-generate code so that you don't have to manually write it.

For example, if you have a class like the following:

public class MyClass {
    private int mId;
    private String mName;
}

Instead of manually writing each accessor (getter) and mutator (setter), go to the menu and click Code->Generate.. (hotkey `alt+insert), then choose the "Getter and Setter" option.

Done. That was fast. And, it will be just as fast with 20+ fields also.

But, wait! By default, Android Studio will include that "m" prefix (stands for "member" variable) in each of the generated method names, so you'll have method names like "setmId" and "getmId". There is a quick permanent fix for this also!

Go to File->Settings->Code Style->Java->Code Generation, then type a single "m" into the "Field", "Name prefix" field. Hit apply, then you are gone. All future code generations will take those "m" prefixes for field into account. Here's a screenshot to what this sentence means visually.

So easy to save a lot of time with Android Studio

That's it for this post. There are lots of other useful code generators also. If you are doing mindless work, it's probably been automated (or should be). ;)

~ Danial Goodwin ~



2014-08-30

Level Up - Android: Speed up your Gradle build times with one-line!

Whether or not you are using Android Studio, Gradle build times are slow (especially when you don't have continuous automated builds (another discussion)).

Here's one way to improve the speed Gradle commands like `assembleRelease` is to enable the Gradle daemon. I've sped up my release builds by about 20%!

2014-08-18

Level Up - Android: How to get started with Unit Testing in Android Studio

Recently, I finally got around to implementing the native unit testing that is provided within Android Studio (not third-party programs like Robolectric). So, after reading a few different sources, the following is the bare minimum that I would have needed in order to add the basic testing features.

2014-01-22

Construct 2 Bug Export To Windows 8: Too many characters in description.

Here's the full error message in Visual Studio:

"The 'Description' attribute is invalid - The value '' is invalid according to its datatype 'http://WPTokens:ST_String' - The actual length is greater than the MaxLength value"

Basically, this error says that your description is too long.

Through trial and error, I've found out that the max allowable length of the Windows 8 app description in WMAppManifest.xml is 256 characters. So, in order to fix this problem, all you have to do open "WMAppManifest.xml", which can be found in the Properties folder of your app's project. Then, edit your description so that it is not as long. I used Notepad++ to count the number of characters in the description.

I spent a few minutes looking for the official documentation for this file, but didn't find it. I found many official resources for Windows 8 that was close, but weren't for the exact file WMAppManifest.xml. Here's one of the links that is something that I'm looking for <link>.

If you know where the official page for this documentation of max length of 256 characters for the description, then please let me know. This bug still hasn't been reported to the developers of Construct 2 yet, because I think there will be other areas around this spot that also has bugs, and I would like to report them all in one go. This will make things much easier for the developer also. And, it's always good to source fixes.



A picture of the error message.


~ Danial Goodwin ~



2013-12-13

C2: Bug Fix for Windows Phone Orientation

Currently, in Construct 2 r152, there is a bug that always puts the Windows Phone 8 export in portrait mode. This can be changed after exporting and viewing in Visual Studios. Open MainPage.xaml, find the line that says orientation or portrait and change that value to landscape, or whatever you would like.

~ Danial Goodwin ~



2013-09-22

Microsoft's App Studio

Today, I wrote two blog posts regarding a new product from Microsoft that allows anybody to easily and quickly create and publish Windows Phone apps.

Learn about it: What Is Microsoft’s App Studio?

Learn more about it: How To Edit App Studio Code

~ Simply Advanced ~



2013-03-23

How To Publish a Windows 8 App Using GameMaker: Studio

This post is going to be one of my longer ones, but no worries. It still contains only the minimum amount of work needed to get done before you have the ability to publish. Here's the official YoYo Games' GameMaker Setup walkthroughhttp://help.yoyogames.com/entries/22361996-Setup-GameMaker-Studio-for-Windows-8

It has some good stuff, but not good enough. You'll be back here in order to successfully publish the Windows 8 app.


So, in this walkthrough, I will show you how to properly create the Windows 8 application for upload, using GameMaker: Studio.

I'll assume you already have:




1. First of all, make sure you have the proper GameMaker program. There are mainly two different ones to choose from. Choose one from http://www.yoyogames.com/gamemaker/studio and you must pay at least the $49.99 in order to publish to Windows 8. You must also have Microsoft Visual Studios 2012 installed.

2. The second biggest problem is not choosing the right target platform. Currently, you must choose "Windows 8 (Javascript)" option from the Target menu near the top (see pic below). Note: If you are using GameMaker in Windows 8, then choosing this method is the only way to save the project too. Having a target of regular Windows causes an error.
Platform target menu circled in red


3. Third, from the menu up top, choose File->Preferences->Windows 8. You should see something that looks like the following screen.

All this was setup for me automatically because I have created a Windows 8 app before. If these fields are not inputted, then please read http://help.yoyogames.com/entries/22361996-Setup-GameMaker-Studio-for-Windows-8. I can't describe the Preferences screen better than that (towards the bottom of the link).

4. Now that the GameMaker Preferences are set up, it is time to setup you project's Global Game Settings.
Double-click to open the Global Game Settings

This is where all other GameMaker to Windows 8 tutorials get messed up. What you need to do is open up Visual Studios 2012 and create a new basic Javascript project. It doesn't matter what you name it (for this tutorial let's call it GameMakerTest). Now, you need to reserve your app name (to ensure that it is available), associate the app with the store to get the package name, and create an app package to get the needed certificate. Where to find these options depends on if you have Visual Studios Express or Full.

4.1. To reserve your app name:

Express: In the menu bar up top: Store->Reserve App Name
Full: In the menu bar up top: Project->Store->Reserve App Name

(A new tab in your browser will open, titled "Submit an app")

Click on "App Name", which should be highlighted in blue in the middle of the screen. Then name your app. Your first choice may be taken already, so choose again. Remember this name because you will use it later back in GameMaker. Don't close this screen because you will use it again after inputting the details into GameMaker.

4.2. To associate app with the Windows Store and get the package name.

Express: In the menu bar up top: Store->Associate app with store
Full: In the menu bar up top: Project->Store->Associate app with store

Sign in with your Microsoft account. Navigate the screens and choose the one that app name that you just reserved for your GameMaker game. (Tip: The last screen shows some helpful information, like your publisher display name, if you don't remember it. You'll need to type that into GameMaker in step 5.)


4.3. To compile app and get a Windows 8 app certificate (to be used later in GameMaker):
Express: In the menu bar up top: Store->Create App Packages
Full: In the menu bar up top: Project->Store->Create App Packages

Sign in with your Microsoft account. You should see the app name that you just resevered, if not, then check the only checkbox that is there. You will need to know both the App Name and Package Identity in the Store. For this tutorial, I'm just going to say copy this information in your favorite text editor for now.
Your names and identities will be different than mine.
Highlight your app name that you want to submit. Click Next. Click Create. Click on the output location link so that the file explorer opens. Navigate one level up by clicking the up button. (You don't need to run the certification kit. It wouldn't work for you at this juncture anyways.)

The file you need here for GameMaker will be called _StoreKey.pfx (Ex: GameMakerTest_StoreKey.pfx). Keep this file explorer open so that you know where to find this file later in GameMaker.

5. Bring your project in GameMaker to the front again. You should still have Global Game Settings open on the Windows 8 tab. I will now walk you through what should go in each of the options.

Display Name - Put in the App Name that your reserved using Visual Studios
Package Name - Use the "Package Identity in the Store" value here. I told you to write this in your favorite text editor.
Package Display Name - Basically, the short name for your Display Name. It can be the same or a condensed version of it.
Publisher Display Name - What is your publisher display name when you created your Windows 8 Developer account? (It probably cost $49, or free if you are a student)
Version - Doesn't really matter. Just make sure it is higher than your last submission.

Each of the images that you see on this screen should be updated before publishing to Windows 8. So, go ahead and do that now. Don't close this screen yet. Come back here after you finish.

Currently, you should be in the General tab of the Windows8 tab in the Global Game Settings. On the left side, click the Installation tab. This is where you need to navigate to the PFX file (Ex: GameMakerTest_StoreKey.pfx). After you do that, click Install. Windows PowerShell will pop up and things will start to look very technical. Just read the options and continue moving forward. Close the Global Game Settings when you are done.

6. All the hard steps are finished. Now it's time to go to the menu bar, File->Create Application. Save it to your location of choice.

Navigate to the location you created the application. Click on the folder, then AppPackages. The *.appxupload is the file you will submit on the Windows website that you should still have open in your browser if you followed this walkthrough word for word.

UPDATE: After running through it again, I found out that you don't need to do step 4.3 if you do step 4.2. Associating the app with the store creates the certificate key. But, I'm leaving step 4.3 in just because it is easier to navigate to the file that way. Just know that next time you do this, you can remember where you save the project to and skip a step.


Please let me know if this walkthrough helped at all or if I should put in any more information. I spent about an hour creating this... after first learning how it do it myself which took much longer. =]

~ Simply Advanced ~



2013-03-11

GameMaker Versus GameMaker Studio

This post will answer the following questions and more like them:

  • "What is the difference between GameMaker 8.1 for Windows and GameMaker Studio?"
  • "Can I upgrade from GameMaker for Windows/Mac to GameMaker Studio?"
  • "Why doesn't the GameMaker licence key work?"

A quick search on the Internet for the above queries and the like do not give an answer. So, I just downloaded both of them and messed with available functions to figure it out. The following gives a basic overview of the differences between the two, which would have helped me when I was first starting. These are all the problems that I encountered when beginning.

  1. The regular GameMaker 8.1 for Windows (version 7 for Mac) is only for creating executables (.exe's) of games and easy exporting to YoYo Games for showcase. This is the version that can be upgraded for $39.99.
  2. No, GameMaker for Windows/Mac is different than the GameMaker Studio suite. I purchased the GameMaker: Studio™ Standard, got the licence key, and tried it multiple times in the GameMaker 8.1 Lite, but it didn't work.
  3. The GameMaker licence key probably doesn't work because you are trying to use a Studio key on the basic version or vise-versa. You need to download the GameMaker Studio version, then input the licence key there. There is also a link to download the proper version in the confirmation email that you will receive.

I hope this helps.

~ Simply Advanced ~