Category Archives: Programming

Cannot get versionName from AndroidManifest.xml?

By | June 3, 2017

If you are running code like this: try { PackageInfo myInfo = getPackageManager().getPackageInfo(getPackageName(),0); versionName = myInfo.versionName; verCode = myInfo.versionCode; } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } TextView myText = (TextView)findViewById(R.id.textView2); myText.setText(versionName + ” – ” + verCode); but the output is not what you are expecting, the chances are you are using gradle to build… Read More »

Need a skin for the Galaxy S range?

By | May 30, 2017

If you are using Android Studio and want to emulate on a Galaxy S6 or any other phone in the S range, you can download the skin from http://developer.samsung.com/galaxy/emulator-skin/s To install it, check out this video here: https://www.youtube.com/watch?v=sSc9D4rrOxw Go to 3:24 of the video to see how to install it in Android Studio.  

Removing Github Commits

By | May 3, 2017

To rewrite history (not usually a good thing to do) you can do the following: git reset –hard <commit hash> git rebase -i HEAD~2 (the 2 goes back 2 commits) git push origin +master refresh github and you should see your commits disappear.

Hello World HTML

By | May 3, 2017

In case you forget how to create the most basic html page ever, here is a reminder:   <html> <header> <title>This is title</title> </header> <body> Hello world </body> </html>  

How do callbacks work?

By | April 14, 2017

Confused about how callbacks work? Check out this really neat example. def say_hello(value, callback): print value callback() def say_name(): print “Fra” say_hello(“ciao”, say_name) Ref: https://bytesforlunch.wordpress.com/2012/03/15/simple-callback-implementation-in-python/

Neat site for svg icons

By | February 17, 2017

This site http://www.flaticon.com has a whole bunch of cool svg for download. SVG stands for Scalable Vector Graphics and uses XML to draw images that do not lose resolution when scaled up. To test your SVG, this site here is very handy https://www.w3schools.com/html/tryit.asp?filename=tryhtml_svg_circle