Category Archives: Uncategorized

Making an android app

I’ve worked on this before and it looked a little tricky. Something about having to download the android program and go from there to make an APK file. Sadly it looks like I didn’t take notes, so I’ll try to do that today.

http://support.andromo.com/kb/distributing/how-to-put-your-app-in-google-play

 

https://support.google.com/googleplay/android-developer/

 

Oh this is useful:

https://docs.unity3d.com/Manual/android-sdksetup.html

 

It looks like I somehow haven’t been saving my apk files in teh right place, or don’t have what I needed downloaded from Unity. I remmeber downloading some sort of android-specific software, but I think that was the wrong idea. Just looked through my applications – looks like I downloaded “Android Studio”. Going to see if I can get away without that for now.

Looks like there’s a Chinese equivalent here that uses SPKs. Not going to download that for now.

https://unity3d.com/partners/xiaomi/guide

Okay so now some things are telling me to go into Unity Preferences, then mess with the SKD root file in External Tools. I keep trying to select a root file, but it keeps resetting – as if it doesn’t like the file I’m selecting.

I searched a little more, and one suggestion was to switch, in Build Settings, from “Internal” to “Gradle.” When I did that, it said that I didn’t have the keystore signing and the key, so it couldn’t do it.

This led to this google search:

keystore signing key unity

 

One user on this forum said:

https://forum.unity.com/threads/android-signing.62137/

For development : No. For publishing (i.e. Android Market) : Yes.

1) Locate the Publishing Settings under PlayerSettings
2) Create a new keystore by selecting a keystore name and password (confirm the password)
3) Select “Create a new key” under Key Alias
4) A new window opens; enter the necessary information.
5) Select the newly created key.
6) Build ( Run); your app is now signed.

That wasn’t very helpful, but these links are:

Creating an Android Keystore on Unity

 

So now I’m left wondering – what’s the US country code? US?

I put that in. But now when I click “Create Key”, it sends me back to this Gogol hellscape “select android sdk root folder” that keeps cycling me in circles like talking on the phone with Comcast.

Time to google that more specifically.

Hmph. Other people have encountered this:

https://forum.unity.com/threads/select-android-sdk-root-folder.128725/

I’m going to see if going into Android Studio like someone in that forum recommended and locating this will help.

OH lol this is literally bc my OS (MacSierra) is HIDING IT FROM ME you stinker.

How To: Show the User Library Folder in macOS Sierra

This website is wrong, holding down the shift key does NOTHING. Now, holding down the option key, THAT gets me somewhere. THERE YOU ARE YOU SNEAKY LIBRARY FOLDER CONTAINING WHAT I NEED

The rest of the website is also wrong for my OS. There is no handy dandy “view library folder” under my user options. But at least I’ve located the source of this fuckery.

I bet this is what’s messing with a lot of my Python scripting, too.

Okay so I don’t know what magic I did but now the Show LIbrary folder is showing, so I checked the HELL OUT OF IT and now it’s showing appropriately in general.

I will never get that 30 mins of my life back. Apple, I’m looking at you.

Okay so then I was aaaaall excited being like I’m gonna go build this android app in Unity right now!!! Aaaand then sadly it still says build failure.

“Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. See the Console for details.”

And in the console:

Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir=”/Users/britts/Library/Android/sdk/tools” -Dfile.encoding=UTF8 -jar “/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar” –

stderr[
Error:Invalid command android
]
stdout[

]
exit code: 64″

 

Some people are saying that there’s a problem with the latest Android update:

https://answers.unity.com/questions/1323731/unable-to-list-target-platforms-please-make-sure-t.html

Oh, cool. Looks like Unity fixes it on their end:

https://stackoverflow.com/questions/42538433/not-finding-android-sdk-unity#

“Unity 5.6.1 / 2017.1 fixes the Android SDK Tools 25.3.1+ compatibility issue. This is noted in Unity bug tracker under issue 888859 and their 5.6.1 release notes.”

I’m using a Unity 5 version. E’s reorganizing/refactoring/encapsulating everything in the most updated Unity version, and nothing important broke, so it looks like the solution to this is updating my Unity. Thank you , Unity updaters!

 

 

More figuring out APK and Android

So I tried a number of things through Android Studio to force Unity 2017.3 to play nicely with android sdk root folder.

https://stackoverflow.com/questions/37313735/unable-to-list-target-platforms-please-make-sure-the-android-sdk-path-is-correc

I tried a bunch of things. The correct thing to do is to download either 25.2.5 sdk or 25.2.3 sdk. I personally did 25.2.5 but I’m seeing both everywhere. Then take the tools folder that that unzips into, and REPLACE the tools folder in the SDK folder. Then it works in Unity.

This video at second 50 solved it for me. Thank you, forum members who linked this: https://issuetracker.unity3d.com/issues/android-build-fails-when-the-latest-android-sdk-tools-25-dot-3-1-version-is-used

(and also discussions here:

https://issuetracker.unity3d.com/issues/the-project-does-not-build-on-android-platform-using-the-updated-android-sdk-tools-26-dot-0-during-the-merging-manifest-files)

Also note that the APK can’t be the debugging version – uncheck everything in the Unity build.

Note that this required keystores etc., I put in my password for both things and was relieved that I handled that on a different day.

Now I have a beta version of Vowel Teams on the Google Play Store.

https://play.google.com/store/apps/details?id=com.ScribbleUp.VowelTeams&ah=bQIMYvTeICWTD3UE61fauuEa0K4&rdid=com.ScribbleUp.VowelTeams

I am concerned that the beta thing will be a pain, and that it would be better just to have it generally on the PlayStore. #todo I need to decide if I buy a chromebook to QA this stuff.

 

 

E’s comments on things

Elijah thoughts 1/16/18

PREFABS:

where you start with things that are 80% filled in

 

and then you set the rest on your instance
and that is just not what prefabs are for

 

 

PLACEMENT OF GAME OBJECTS IN EDITOR:

the main thing I’ve learned
is you ALWAYS ALWAYS ALWAYS instantiate a prefab by dragging it on top of the word “Canvas” on the left-hand side menu
NEVER at the top level, NEVER in any other little sub-object, NEVER just onto the screen
because putting it in any of those places gives Unity the opportunity to MONKEY

SPRITES:

  • sprites are NEVER to be dragged-and-dropped anywhere

 

  • you must add an Image as a subcomponent on a GameObject and then drag the sprite into that Image on the right-hand submenu
  • and if you do anything else, may god have mercy on your soul
CANVAS SETTINGS:
yeah
but
not just a default Canvas
a canvas that has all the right-hand side menu settings selected properly
which I herein define as “carefully duplicating the settings I found from your other scenes”
Render Mode, Render Camera, and UI Scale Mode all need to be set to the proper thing on the Canvas subsettings
and if any one of the three are off, well, you can just go to hell
when I set any of those three things to literally anything other than what you had
the whole fucking thing blows up in my face
so yes
I like those settings

Adding in Content

And writing a business plan.

Finished that first bit, more or less. Now my goals are to make python scripts that make it super easy to add content.

Eventually these should probably be in C# and be different sides of the same app. But for now, I want to be able to make it by myself, and control and sanity check it, and have it to fall back on if it gets made in C# later and something breaks. #todo

I’ve pretty much written the necessary script with the necessary accompanying text files. It’s all in Dropbox/2017Winter . It’s named Prep-CVC-Level-from-List

#todo – write up what this script does and how it interacts with nearby text files

Okay, so now I need unique names for the org I’m writing a level for – and then a unique string to identify how that level came to be. I’m going to start with Word Wonders at St.L,

 

StL.K.U1.#

(School – Grade  – Unit # – level #)

So here’s a problem with this – they don’t always have the “right” number of things for each level – so I need to make the levels auto-populate so that they can have anywhere from 1 – 4 things, and then make the levels auto-split? (OR do this manually for now, and have like parts .1 etc.)

Also, I’m going to skip the high-freq words for now. I want to add those back in but need to think more about it. #todo

#todo – question – will teachers be upset if names aren’t capitalized?

Hmph. I might also want to add in a thing that spefiically does CVC words … so I’m not retyping “c.a.t” and all possible variatns. but maybe I’ll just do it. #todo

 

Just added this in :

#this one lets us do things like “am” and still call it a “CVC” word
elif len(wordParts) == 2:
# onset = wordParts[0]
# onsets.append(onset)

nucleus = wordParts[0]
nuclei.append(nucleus)

coda = wordParts[1]
codas.append(coda)

 

Oh gosh – apparently I forgot how to do & | in python if statements?

https://stackoverflow.com/questions/2485466/pythons-equivalent-of-logical-and-in-an-if-statement

I could’ve sworn I could use “|”, but looks like I have to use “or”. HUH. IS THAT NEW

I also need to make wordbank so that it doesn’t have duplicates :/

Okay I made it so it doens’t have duplicates. Good job me.

    // #todoDec  this is a spot where the locations are hardcoded :/ 
        positions.Add(new Vector3 (4.13f, 2.7f, 0f)); // position0

#TODO – a thing I haven’t mentioned is that at some point in this, my locking-in mechanism … well it just kinda broke. I have no idea why it no longer works, but it sure doesn’t!

#TODO  for making it so it instantiates objects as clones instead of hardwired in

  1. Clones don’t change the names like I need. I’m pretty sure that there are 3(+?) things that need names in an order:
    1. AnswerSlots#
    2. AnswerSlotCollider#
    3. position_# [note this one is esp … sthing … bc position_10 and 11 have a Q in front of them because otherwise it doesn’t alphabetize correctly – maybe I need a python function that does ordinality instead of alphabetizing? #todo]
    4. A thing that will need to be adjusted, either here or elsewhere, is that it uses the SceneName to find the sound resources. Let’s take care of that now by just having everything route to VowelTeams for now (#todo). I’d also love to have it throw better error messages if it’s missing sounds – right now it just sends a PROBLEM to the Debug.Log (#todo).
    5. I’m also going to need to adjust this for how many things are expected to go into colliders before the Check button shows up. This is in AnswerColliderVowelTeams.cs , which is attached to AnswerSlotsCollider, which is under AnswerBlocks, under Canvas.
    6. In GameManager, there is a set of locations for each block’s collider position, marked as #todoDec .
    7. I just added in a public int into the GameManager named “answerNumber” – that’s going to be how many words there are in the level, so I can use that in the Collider so that it shows the Check button at the right time [OMG I DON”T NEED THAT bc what I actualy want is “3” which I was geting from “answerkey” length]
    8. Oh gosh I have it hardcoded in ShowVowelTeams.cs that there are 4 words. For example: word1, word2, etc… This would be a nice spot for a forloop that did all of them instead of each of them being replicated. But right now I’m just going to add a thing at the top that’s like “if ther eare this many words then do it”. NOTE: This does actually mean that I need the thing I talked about in #7, because I don’t want to be dividing to figure out the number of words in a level, bc some might have 2 sounds and some might have 3.  SO I added this back in (answerNumber as a public on GameManager), but somehow it thinks there are 2 answers … that may just be counting the levles.
      1. Okay so I now am able to collect this. It’s in WordDictAdd
      2.         // Im trying to collect how many words are in the level :/ #todoDec
                if (name == answer) 
                {
                    GameManager.instance.answerNumber = filler.Length;
                }
    9. Now back to the hack in #8, now that I know how many words there are. Okay, that part now works – check answer button is just fine
    10. A part that ISN”T fine is that it’s now showing all of the empty stars, even though there is only 1 word. So I need to attach that to how many words there are. Where is that, one might ask? Well. Um.
      1. okay that also appears to be in ShowVowelTeams, which is attached to the CheckAnswer Button.
      2. There’s something to help kids who got everything wrong, which is that it shows all the answers if correctwords is <1. This may be off for when there are only 1 or 2 words, but I’ll keep it for now and see how it works – let’s keep an eye on it.         // #todoDec  this will need to be only cued if its enough words to matter
                if (correctWords < 1) {
      3. Here’s the thing that enables empty stars:          int progressBlockCounterEmpty = 0;        //#todoDec  this puts the empty starts into the scene. However, I only want as many of them as there are words. 
                foreach (GameObject progressBlockEmpty in progressBlocksEmpty) 
                {
                    
                        progressBlockEmpty.gameObject.GetComponent<SpriteRenderer> ().enabled = true;
                }

 

Put WebGL online

There’s an indie game marketplace called Itch.io that seems doable … but is it just a download?

 

 

https://www.gamasutra.com/blogs/KevinMurphy/20160125/264217/Unity_WebGL_for_Dummies_like_me.php

 

This place tells me to do Dropbox – but there’s no longer dropbox public folders.  🙁 I miss those.

 

This place is telling me that Safari (and some other things, particularly older ones) support UnityWebGL. I still don’t know if that requires downloading the Unity plugin, but that might be easier than other ways of doing this.

https://cyberanatomy.freshdesk.com/support/solutions/articles/3000040886-what-web-browsers-support-the-unity-web-player-

Ah – so we have to install the unity webplayer.

 

Okay, so this looks like it might be promising to play from my website:

I might need to do something funky with Dropbox access to url:

https://forum.unity.com/threads/anyone-know-how-to-embed-webgl-generated-by-unity-5-into-squarespace-webpage.356500/

 

Okay SO

Now I have a web browser version working (ish – clear bugssss) in itch.io:

https://scribbleup.itch.io/vowelteamsdemo

It’s in the draft version so only I can play with it so far, but it’s promising that it’s closer to working in a browser.

I hear from these other sites that I could even have it embedded directly in my squarespace. That would be ideal.

I’ve been trying with SquareSpace and it’s nto working great …

http://www.muno.space/code-snippets/uploading-files

https://forum.unity.com/threads/anyone-know-how-to-embed-webgl-generated-by-unity-5-into-squarespace-webpage.356500/

https://answers.unity.com/questions/1127108/unity-webgl-builds-on-a-squarespace-site.html

 

Okay now I used the widget from itch.io and that worked. WOOO

Have NOT been ablet o make it work from a dropbox link, or make it even downlaod the app from a dropbox link. Would like to look more into that so that downloads are super easy, but I’ll do that later. Schools are fine with just the .app and I can do it in dropbox or a googledrive – no one’s really asking for a web browser right now.

Instantiate buttons based on txt file

I’ve done this before, but don’t remember where.

https://docs.unity3d.com/Manual/InstantiatingPrefabs.html

http://answers.unity3d.com/questions/18219/instantiate-prefab-with-c-script.html

https://docs.unity3d.com/ScriptReference/Object.Instantiate.html

 

As child of canvas:

http://answers.unity3d.com/questions/1226961/instantiate-prefab-from-script-inside-a-canvas.html

Hmph. Something has been going wrong with how I tried to do this, so I gave up. I want to come back to this later. #todo

 

Okay, coming back to this on 9-21-17. Maybe I can figure this out today, I feel like I need a problem to solve.

 

Build numbers

Huh, I had never changed my build number before!

https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html#//apple_ref/doc/uid/TP40011225-CH33-SW9

It’s literally input box #4 on Xcode. Cool, that’ll help me!

Making canvas UI elements look good

So I’m struggling with my canvas elements cuz they come out the wrong size and the wrong place. This has been affecting my menus, but more importantly, my  Check Asnwer button now ovelraps with other things, and it looks bad.

WHOAH just change the canvas scaler on each of the scene’s canvases from Pixel relative to Screen Size relative and then everythign is fixed.

https://docs.unity3d.com/Manual/script-CanvasScaler.html

 

YAYYYY

Fixing GameManager

Right now I’m having this annoying thing happen where the ShortLongA scene works when it’s opened by itself, but it doesn’t work when it goes through the Menu button.

Specifcially, the gamemanager instance isn’t finding the CheckHideButton and the CheckHideText automatically. That means it’s somewhere in a script that’s not getting activated by the menu button, but IS getting activated when the program starts.

OOH maybe it’s in Awake? How does Awake work exactly, is it for the scene or .. hmmm…

Yes I think it is! I’ts in the Awake in gthe game amnager, and that only happens once in the game (I think…?)

I added the defining of the CheckButton and text to the Propogate Scene script, and that fixed it.

YAY!

ALthough now I seem to have a problem with my login. I think that’s because it didn’t have a GM loader? Yup, adding the GM loader fixed that too. Cool!

Add username and password

So for this, I don’t have a server background yet. I’m just going to embed it into my unity stuff.

I’ve got it so that it works by using InputField, but I have the following questions:

  • how do I make it so it only has to log in once
  • is there any way to make it so they don’t have to log into every app on every ipad? this feels annoying & sad, and would really detract from teachers being able to use it
  • is there any way to keep the login info on new version

Things I’m looking at

  • https://gamedev.stackexchange.com/questions/135915/unity-5-input-field-how-to-confirm-password-entry-with-enter-only-and-not-a

Maybe I’d rather have something like this:

https://docs.unity3d.com/ScriptReference/SystemInfo-deviceUniqueIdentifier.html

If there’s a unique identifier on each ipad, then I can actually control how many ipads are using my app, and know which ones are…

BUt  now that I’m thinking about it while writing the code … // this confirms that its a specific ipad using the app  this ... wont work bc it wont get past the app store

Hmph.

http://www.assistiveware.com/support/faq/page/50

One thing I could do is just put my templates on the app store, and put everything else on TestFlight. I don’t know how that works with the auto updating thing the school has, but it could sidestep this annoyance.

Looks like I can at least only login once per ipad. Not sure how th is would work for updated versions, or the fact that I’m planning on having multiple apps :/

http://answers.unity3d.com/questions/1272349/load-different-scene-on-first-load.html

It would probably be a good idea for me to get a second ipad at some point and set it up to download the way the school does, so I can test these things out #todo