Friday, March 28, 2014

Java 8 is available

JDK™ 8 Early Access Releases 8u20 Build b05 

https://jdk8.java.net/download.html

Wednesday, March 26, 2014

My Mac crashes Wireless Network every time

I work remotely most of the time, but when coming to the office the wireless network would crash every time. I thought it was bad router, but my co-workers started to notice it happens only when I connect. The network would slow down to a craw and crash.

I was eventually BANNED FROM NETWORK! :) 

I though I had some apps like Dropbox hugging the network, but it did not seem like it.



I have read that connecting to external DNS, not your Internet Provider's DNS, servers might speed up the lookup.

I got this list from support.hidemyass.com

  • OpenDNS: 208.67.222.222 + 208.67.220.220    
  • GoogleDNS: 8.8.4.4 + 8.8.8.8
  • ComodoDNS: 156.154.70.22 + 156.154.71.22    
  • UltraDNS: 156.154.70.1 + 156.154.71.1    
  • NortonDNS: 198.153.192.1 + 198.153.194.1

To do so I got to:
Apple > System Preferences.. > Network > Wi-Fi (Connected) > Advanced .. > DNS


Add caption



Tuesday, March 18, 2014

Android Keystore and certificates for Facebook and Google Map APIs

In the Terminal:
1) change directory to place where you want to save your keystore
 
@ Android_Keystore $ which keytool
/usr/bin/keytool
   
2) change command to something like this, execute it

keytool -genkey -v -keystore MyCompanyName-release-key.keystore -alias MyApp_name -keyalg RSA -keysize 2048 -validity 10000

3) you will be asked for two sets of passwords, if you have multiple developer groups working on different apps then provide different. If you are single developer for single app then you can keep them same.

The process will look like this:
What is your first and last name?
  [Uki]:  Uki Lucas
What is the name of your organizational unit?
  [CyberWalkAbout]:  CyberWalkAbout
What is the name of your organization?
  [CyberWalkAbout.com]:  CyberWalkAbout.com
What is the name of your City or Locality?
  [Chicago, IL]:  Chicago
What is the name of your State or Province?
  [IL]:  IL
What is the two-letter country code for this unit?
  [US]:  US
Is CN=Uki Lucas, OU=CyberWalkAbout, O=CyberWalkAbout.com, L=Chicago, ST=IL, C=US correct?
  [no]:  yes
Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with a validity of 10,000 days
for: CN=Uki Lucas, OU=CyberWalkAbout, O=CyberWalkAbout.com, L=Chicago, ST=IL, C=US
Enter key password for <CyberFit_alias>
(RETURN if same as keystore password):  
Re-enter new password: 
[Storing CyberFit-release-key.keystore]
---------------
You will need this for Facebook:
@ Android_Keystore $ keytool -exportcert -alias CyberFit_alias -keystore CyberFit-release-key.keystore | openssl sha1 -binary | openssl base64 Enter keystore password:
---------------
You will need this for Google APIs (maps)
@ Android_Keystore $ keytool -exportcert -alias CyberFit_alias -keystore CyberFit-release-key.keystore -list -v Enter keystore password:
   

Writing Java Mac OS X apps with SWT

I have been playing with idea of Mac desktop apps, I don't have a tutorial yet, but here are few links:


SWT: The Standard Widget Toolkit
http://www.eclipse.org/swt/

Deploying SWT Applications on Mac OS X
http://www.eclipse.org/swt/macosx/


Mac .app 
The .app is just a directory with a specific structure and a few special files.
AppName.app/Contents/Resources/Java/AppName.jar.

Tuesday, March 11, 2014

Ant tool on Mac Maverick 10.9.2

Apple as usually is playing a game with developers:

$ ant clean
-bash: ant: command not found


$ xcode-select --install
xcode-select: note: install requested for command line developer tools
- Agree
- Finding Software
- Server not available 


Another way:

$ which brew
- nothing
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

$ brew install ant
==> Downloading http://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.3-bin.tar.gz
Error: Failed to download resource "ant"
Couldn't determine mirror, try again later.

Trying another approach:

@ ~ $ brew install homebrew/dupes/ant
Cloning into '/usr/local/Library/Taps/homebrew-dupes'...
error: RPC failed; result=7, HTTP code = 0
fatal: The remote end hung up unexpectedly
@ ~ $ ant

-bash: ant: command not found

Another approach:
got to http://ant.apache.org/bindownload.cgi
for half a day I was getting server error, but finally in the evening I was able to download:

/usr/local/apache-ant-1.9.3-bin.zip
upzip it
$ cd /usr/local/apache-ant-1.9.3/bin
$ ./ant
Buildfile: build.xml does not exist!
WORKS!
$ edit ~/.profile

Add this to your .profile file

# ANT
export ANT_HOME=/usr/local/apache-ant-1.9.3
export PATH=${PATH}:${ANT_HOME}/bin

Save and Restart terminal 

Now ant command works from any directory.






Wednesday, March 5, 2014

ADB via USB on Samsung Galaxy Note 12.1 running KitKat

Many of you already know that, but since it is easy to forget here is a reminder how to turn ON the

"{}Developer options"

on devices running Android 4.4.x KitKat

Go to: Settings > General (tab) > About device

tap few times on "Build number" until the "{}Developer options" show in the left menu.



In "{}Developer options" 
- select USB debugging
I also often keep these 2 options selected when I share the device screen in demonstrations:
- Show touches
- Show pointer location
You can see the infinite sign I drew with my finger


For the screen sharing and capture I use command line software called "droid@screen"