Install CodeLens In Visual Studio Community 2015




Microsoft is obviously making a step to make tools that affordable for everyone, for a small company that has less than 5 users can actually use Visual Studio Community 2015, please read the license here, there are other terms and conditions need to fulfill in order to use this. PLEASE READ!!! :).

Recently, we decided to move from Visual Studio 2015 professional into Visual Studio Community 2015 (Still not sure how deep is the impact), and noticed some of the cool features had been gone from the text editor, the CodeLens !!!. That’s really annoyed me for awhile as something seems missing from my view.

View Demo – Install CodeLens In Visual Studio Community 2015


What is the different between these 2 versions?

  1. No CodeLens!!!
  2. No Team Foundation Server features. (We could use Git or TFS Express :). )
    You can have a look on the differences here

In case, you are like me would like to save money but at the same time still maintain to use the great features that available in another version of the visual studio, CodeLens, then we are about to show you how to install CodeLens that doesn’t include in the original package.

The 2 Steps !!!

1. Download SQL Server Data Tools (SSDT). You may have questions why the SSDT has to do with CodeLens? Ya make sense when i first install i got the same question as well but obviously the CodeLens had bundle in SSDT!!! lol.
2. When you are in this screen, make sure you tick these 3 checkboxes even you do not wish to install. In case you don’t like to have this in your machine you could choose to uninstall SSDT, but some of the components still remain in the machine so the CodeLens still can use πŸ™ (Good??? with all the garbage files?? Well depend how you judge it πŸ˜› )
CodeLen_01

3. After installation done, you should manage to see the CodeLens appear as before.

In case you want to get any future post, please follow us on facebook, google+, and tweeter. πŸ˜›




Android Studio Eat Up My Hard disk Space




I have 200GB on my C drive and Windows keep prompting me on low disk space on this drive, and this drive does not have any data storage just software. I’m the type of person very careful on the software to be installed on my machine. So I’m quite surprised why I ended up with low hard disk space.

So I decided to take a look which software been occupied most of the space. I used spacesniffer to help me on this and it’s free!

Delete All Unused Emulator

Have a look at this image, and can you spot who’s the culprit? Yes, Android Studio!!!. Android Studio Eat Up my Hard disk Space!!!
Android Studio Eat Up My Hard disk Space

This image was captured after I perform this step, free up ~10GB!!!

Delete all unnecessary emulator that is not going to use anyway. Now I keep 2 emulators that I usually used. For the time being, I still switching between GenyMotion and Android Emulator 2.0 because I still not quite comfortable with the Android Emulator 2.0 except it’s free. πŸ™‚ .

Delete Emulator’s Temp Files

From the 2nd image, even though I have deleted the emulators but I still see 16.5GB of temp folder which located in this directory C:\Users\[username]\AppData\Local\Temp\AndroidEmulator .

Android Studio Eat Up My Hard disk Space

Have a look at the last modified date these files had been a while never used. So I guess is safe to delete all these files
Android Studio Eat Up My Hard disk Space

Delete Old Version Android Studio

Have a look at the below image, free up another ~20GB!!!. I still not satisfied because it still occupied quite a big portion of the space, checking further and noticed another abandon folders no-one care their existence in my hard disk, the old version of Android Studio, these files not removed when we upgrade to the new version. So remove all the old version folder except the latest version which is .Android 2.0. And it gives me back another ~16GB.
Android Studio Eat Up My Hard disk Space

Android Studio Eat Up My Hard disk Space

All together I claimed back ~50gb because all these “rubbish” files and folder. And the most important thing is after all these files been deleted Android Studio 2.0 still running well. :). There are some other folders like Android SDK, I still keeping it for testing purposes. If you’re sure you’re not going to use that so why still keep those files πŸ˜‰

The lesson of this is you need to housekeep your machine whenever is possible not until your machine’s performance degraded. πŸ˜› . That’s all, please comment if you found some other files that can be deleted too. :P.

In case you want to get any future post, please follow us on facebook, google+, and tweeter. πŸ˜›




Android Studio 2.0 is in Stable Channel!




Android Studio 2.0 finally released in Stable Channel (I knew it was already on the Canary channel for months but I prefer Stable Channel πŸ˜› ). Why I’m excited about this version, as you can see this is a major upgrade version from 1.5.1 to 2.0 and one of the features that keep me waiting for months is Android Emulator 2.0. The main focus in this release is helping us speeding up the development process. So in this short article, we just like to show you these 2 features (which I care the most), the complete release notes you can find it here

1. Instant Run:

This is something that every developer love to see. Before this, when we make a minor change to the code we need to build the app and wait for the app to deploy into emulator or devives. Now, with Android Studio 2.0, for some cases you can change your code and see the result immediately WITHOUT NEED to wait for the redeployed process, Cool!!

So let’s try with example after you deployed app to the emulator or device. And then you make a minor change to the code you will notice the icon for both of these will have a thunderbolt icon sit next to them like this.

Android Studio 2.0 is in Stable Channel!

This Indicating that Instant Run is ready push updates the next time you click the button. When you click these button and notice the screen display this. Haa… I like this. :).

Android Studio 2.0 is in Stable Channel!

You still need to redeploy the App after you satisfied with the result because it is still not deployed the changes to the targeted device.

2. Android Emulator 2.0

In order for you to use this brand new Android Emulator 2.0, you need do the following
1. Start the SDK Manager from Android Studio.
Android Studio 2.0 is in Stable Channel!

2. In the SDK Platforms tab, update the latest SDK, in this case Android 6.0 (Marshmallow).
Android Studio 2.0 is in Stable Channel!

3. Click the SDK Tools tab, make sure you have the following

  • Android SDK Tools (25.0.0 or higher to get the new emulator)
  • Android SDK Platform-Tools (23.1.0 or higher to get the fast ADB)
  • Intel x86 Emulator Accelerator (HAXM installer) (rev 6.0.1 or higher to get CPU acceleration)
  • Click OK to check for updates.
    Android Studio 2.0 is in Stable Channel!

    4. After installation complete, you need to restart Android Studio then open the AVD Manager. You may have this message on your AVD manager, So just click the Reinstall Haxm, to update Virtual Machine acceleration driver, and leave the rest as default.

    5. Click Create Virtual Device. Then Select the defaults for Nexus 6.
    Android Studio 2.0 is in Stable Channel!

    6. Select Marshmallow – API 23 – x86 as system image.
    Android Studio 2.0 is in Stable Channel!

    7. Select Show Advanced Settings.
    Android Studio 2.0 is in Stable Channel!

    8. Select the Multi-Core CPU check box. The number of cores available depends on the number of cores available on your development machine.
    Android Studio 2.0 is in Stable Channel!

    9. Give a name to your emulator, and run your new Android Virtual Device by click on the green Play button.You should see the Android Emulator.
    Android Studio 2.0 is in Stable Channel!
    Android Studio 2.0 is in Stable Channel!

    For the Emulator 2.0, I still feel slow on my machine and my machine CPU are quite busy when the emulator started and for the memory consumption is still crazy cause my machine slowing down. (Hmmm must be something goes wrong). Besides, we can see from above screen there is a toolbar on the right side to help us to rotate the screen, turn off screen, soft back keys, etc. Before this we need to remember every these combination shortcut keys. A bit disappointed but overall is still fine so I still will give it a try. πŸ™‚

    These are the 2 things I like the most. What about you? Share your thought and tell us what others feature you been wanting most had been released in this version. And if you have not updated to Android 2.0 You should DO Now!!!

    That’s all, if you feel this tutorial not confuse you and want to get any future post, please follow us on facebook, google+, and tweeter. πŸ˜›




    Android Studio Facebook Login Share Like Tutorial – Part 2




    After the Facebook App configuration from previous tutorial, you should have the Facebook App ID, if you haven’t got it or new to this, please have a look on the tutorial.

    Tools Used
    1. Android Studio 1.5.1 2.0
    2. Facebook SDK 4.11.0

    Todo
    We will create an app that allows user to login using their facebook account and views some of the basic information. Other than that, we will add 2 more buttons, facebook share and like button to let user like and share. πŸ™‚

    Want to make sure this code is working? No Problem, check out this video! πŸ™‚

    View Demo – Android Studio Facebook Login Share Like Tutorial


    Android Studio Facebook Login Share Like Tutorial – Part 2


    Screen Layout
    These are the 2 screens that we going to build. Basically, the 1st screen is for login and then the 2nd screen for the user to view basic information which we will get this information via Facebook GraphRequest. and also contains 1 facebook share button and like button.

    1. Create Project

    Let’s start this by creating a project and name it FB from Android Studio, see below for the rest of the setting. Please take note as the facebook requirement we need (API Level 15) or higher.

    2. Add Facebook SDK to Your Project

    To use Facebook SDK in a project, add it as a build dependency and import it, please navigate to app>build.gradle

    3. Configure Facebook App ID

    We obtain facebook app ID from the previous tutorial, so now is time to set this in our project. Please navigate to app>src>main>res>values>strings.xml and paste the following content

    Please take note on the highlighted line, you need to replace with your Facebook App Id that getting from the previous tutorial.

    3. Configure Facebook App ID in AndroidManifest.xml

    The 2nd place that needs the Facebook App ID is manifest file, please go to app>src>main>AndroidManifest.xml and paste the following content

    Please make sure you have all the highlighted lines in AndroidManifest.xml file and also take a look on the last highlighted section, you need to use your Facebook ID, for example ,com.facebook.app.FacebookContentProvider[APP_ID], change [APP_ID] with your ID, in our case the Facebook App Id is 1584671128490867.

    4. Prepare The Resources

    This is totally unnecessary step, but just for UI to look better by little (maybe not even 1%, πŸ˜‰ ), download these 4 images 1,2,3,4 or you can get it from the downloadable project, and paste in app>src>main>res>drawable

    Icons made by Bogdan Rosu from www.flaticon.com is licensed by CC 3.0 BY
    Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

    5. Code The Layout

    There are two ways to implement Facebook login on Android

  • LoginButton – By using the method, we will need to place a button on the screen
  • LoginManager – Initiate nitiate login without using a UI element.
  • In this tutorial we will using the LoginButton method, so we’ll going to place the Facebook Login button in activity_login.xml but before that we like to customize a little on the button and so please navigate to app>src>main>res>values> replace with the following files content

    Now, please navigate to app>src>main>res>layout replace activity_login.xml with following content

    For the 2nd screen which will display logged in user’s basic information and have Facebook Share and Facebook Like button for you to play around πŸ™‚ , in the same folder, please add 1 more file and name it MainActivity.java and replace with following content

    6. Code

    Please navigate to app>src>main>java>com.instinctcoder.fb, and paste the following code

    And then in the same folder replace MainActivity.java with the following content

    That’s all, if you feel this tutorial not confuse you and want to get any future post, please follow us on facebook, google+, and tweeter. πŸ˜›




    Android Studio Facebook Login Share Like Tutorial – Part 1




    In this tutorial, we would like to show you how to integrate facebook login , share and like function into Android App. We will begin this series of the tutorial with setup Facebook Developer account and some of the configuration we must do before we start the coding.

    We found it a bit too long to put everything in a single post, so we will split this tutorial into small pieces so you won’t feel the article is too long for you to digest (I personally don’t like to read long essay πŸ˜› )

    1. Create New App
    Please go to Facebook Developer site and at the top right corners click there is a dropdown, click on the the dropdown > Add a New App > Click on Android > Type Social Test

    In the next screen, type in contact email and choose No for “Is this a test version of another app? and choose the category which is best describe your app, for our case, we choose Education. and click Create App ID

    The next screen you will see few steps to ask you to configure your project to have use the minimum of API version. we skip this for the moment and please check this part of the screen and copy and keep the Facebook App ID and we will use in later step/tutorial.

    2. Package Name And Default Class
    Now Move on the bottom of the screen, you need to key in Package Name and Default class for this case we will type in as follow
    Package Name: com.instinctcoder.fb
    Default Class: com.instinctcoder.fb.LoginActvity

    Click next and you might see some warning popup like screen below, this could be due with some rule checking that can’t be pass at the Google Play checking. Is fine for now, as we just doing some testing. as click Use this package name.

    3. Add your development and release key hashes
    Method 1
    The next screen require you to generate hashes key, for this you need to install openssl, there is few options for you to pick so pick the one most suitable for your environment. For me , Windows 7 Professional, i download this and unzip to this location > C:\Users\data\certs\

    The next thing we need to do is use keytool to generate the hash key and this Keytool bundle in the Java Development Kit. So, Please start the Command Prompt (cmd) use these command to generate the Hash Keys

    Basically, you will see the result like below image in your cmd screen, and copy out and then fill it into key hashes in facebook developer page like below, and click next.

    In case you have this warning can’t open config file, please run this command first set OPENSSL_CONF= YOUR_OPENSSL_CONFIG, for this example: set OPENSSL_CONF= C:\Users\data\certs\openssl.cnf

    Method 2
    In my case, I hit by an error Invalid Hash Key when I run my apps on emulator with facebook apps installed, have a look at this image.

    Android Studio Facebook Login Share Like Tutorial - Part 1

    If you encountered with this issue, if you can read the error from the above image then type it out and then fill it into key hashes in facebook developer page. Or you like me, a normal human, then just paste the below code into your code and get the key from the LogCat. Don’t worry about this part, we will show this piece of code in this tutorial

    That’s all for the configuration. -_-‘ . In the next part of this series, we will use the above configuration information to integrate facebook Login, Share and Like into the app. Stay tuned!