Tuesday, November 28, 2017

Cordova file transfer plugin not working windows 10 - Update


Found a new reason for this problem. Every time I had this issue I had open season in fiddler software. Once I closed fiddler the issue was gone.

Sunday, November 5, 2017

Apache cordova scroll bar lagging on Android and iOS devices


When its come to developing hybrid mobile applications, Apache Cordova is amazing free  development tool which is supported by most popular IDE's like Microsoft Visual Studio. For more details about the Microsoft Visual Studio tools for apache cordova  please follow the link bellow.

https://www.visualstudio.com/vs/cordova/


In this article I assume that the reader is a cordova developer, and I'm not going to teach you  the basics for that there are millions of articles  you can find in web.

So if you are using jQuery, jQuery UI and row java scripts with apache cordova it's still ok if you developing some demo project or a pretty simple app.

But for  a commercial level project you must use Angular JS or higher angular version ( IONIC Framework - Extended version of cordova ) to get better user experience.

I have no offence towards to jQuery and jQuery UI as they are still great tools. But when it's come to hybrid application development Angular perform lot better than jQuery or jQuery UI.

Tuesday, October 31, 2017

Cancel NORD VPN and get the refund.


Recently I purchased nord-vpn for testing. But I could not use their service due to a technical reason. So I wanted to cancel and get my money back. In their website they don't have any user interface to do such an operation. So only way to cancel nord-vpn is to contact them via Email. 

1. Send an email to support@nordvpn.com saying that you need to cancel nord-vpn and get your money back,

2. They will reply you and ask the reason for cancellation.

3. Reply back with your reason and said you want your money back.

** You only have 30 days to get money back option and if you purchase via itunes they cant refund your money.


Sunday, October 15, 2017

Angular JS drop-down first options vs jQuery UI.


Hi All

Recently I had an issue with angular-js dropdown  which had ng-repeat to load it's options from a web service. Problem was I always could see an empty option even if I dont need that empty option. I needed to show the first real option to my users.

So I googled and see lot of answers but non of them did not work for me. My case was really rare.
My app was kind of converted app from jquery mobile to angular. So I had some jQuery mobile reference as well. Also I realised that my drop down had jquery mobile styles as well.

So all I did was removing all references to jQuery mobile js and jQuery mobile css. So everything works now.


So the conclusion is 

1. If you have any problems with angular data-bindings please remove jquery mobile references.



Removing click delays in iOS - apache cordova apps


 I started to use Angular JS in cordova for iOS. Every thing was perfect except I experienced a delay in response to ng-click function. In windows and android I did not see that delay.

Finally after we searches I found the solutions  You just need to include the fast click library from bellow url.


 https://github.com/ftlabs/fastclick 

Now if you using winstore-js-compact.js to fixed problems with angular in windows environment you cant refer fast-click library as a direct javascript reference. Instead of that add your script as follows.

       if (cordova.platformId == "ios") {
            /*  Add fast-click.j's content  to here */
       }

Wednesday, September 6, 2017

The imported project "C:\Program Files (x86)\Microsoft SDKs\TypeScript\build\Microsoft.TypeScript.targets" was not found


All I did  to create above mess is...

1. Installing visual studio 2017 while working on visual studio 2015.
2. And I stopped the visual studio 2017 installation as I thought I would  do it in another day.


So the setup application has removed my installed typescript  plugin.  All you have to do is
install type script for Visual Studio 2015. You can download the setup from bellow link.


https://www.microsoft.com/en-us/download/details.aspx?id=48593




Monday, August 21, 2017

Google chrome cache not clearing


We had this caching problem in one of our windows 8.1 computer. But I'm sure this issue is exist in all new version of windows and chrome.

So this is what we did to clear the google chrome cache and none of this work for us.

1. Clear cache using google chrome options.
2. Full page reload ( Ctrl + F5 )
3. Uninstall  google chrome install again.

So the conclusion is google chrome getting cached data from somewhere in your own hard disk. Sorry I didn't know exact location right now. ( Will find it and update ) .

All I did was doing a disk cleanup for the partition which has windows OS installed.  To do this please follow bellow steps and its  better to restart after doing this.

1. Right click on the drive.
2. Go to properties.
3. Click on disk cleanup button wait till you see the report.
4. Check all options in side the dialog window.
5. Click on OK button.
6. Restart windows.







 

iTunes won't open windows 10 64 bit


There are few solutions for this problem.

1. Run itunes as an administrator. If you are an admin user of your windows 10 computer this is the easiest way to fix the problem.


2. Uninstall and Install iTunes software. ( You need admin access for this as well )


3. Ask your administrator to install windows updated and itunes updated version.


First solution worked for me.



Monday, August 7, 2017

System.Security.Cryptography.CryptographicException: Access denied. ( IIS and X509 Client Authentication Certificate )


 I'm using following code part to access a ReST API. I'm communicating with this API using a X509 client certificate.






In development site which I have IIS 10.0 its working without any issues. But after publishing on windows server 2012 R2 and using IIS 8.5 on windows server it's giving me following error.

System.Security.Cryptography.CryptographicException: Access denied.

This happened even if I gave full rights to the machine key folder.

Ok. Lets focus on  the solution.

First I added certificate to user key set from code instead of machine key folder.


var certificate = new X509Certificate2(objApiCertficate.CertificateData, this.strApiPassword, X509KeyStorageFlags.UserKeySet);
                    certHandler.ClientCertificates.Add(certificate);






Then you have to load user profile in your application pool.






Please restart IIS before test this. 


Thursday, June 22, 2017

Unable to resolve host '' ubuntu 14.04



I face this issue when I was adding new web site to my web server which is hosted in Digital Ocean Cloud service.  So what happened was, when I using sudo commands to restart or reload apache2 server its restring with following error messages.

For me everything worked well despite these two  error messages.

1. Error 1 - Unable to resolve host 'YOUR HOST NAME'  .
2. Error 2 - sum_functio_error() //I don't remember this function name I'll update this later.

So the fix was very simple.

First open your hotsts file.

sudo nano /etc/hosts

Output File

127.0.1.1 hostname
127.0.0.1 localhost


sudo nano /etc/hostname


Output File

hostnamexxx



So in my case hostname in hostname file and hosts file difference.So  I put the hostnamexxx in hosts file and restarted the server.

*You have to restart your server to apply any hosts file changes.


Please comment bellow if you need further explanation.








Tuesday, June 13, 2017

SMS sending from old number even after transferring the number - iphone 6 ( Australia )


I came across this problem after I changed my mobile provider. Transfer of number was successful and I was able to call from my old number. But the problem was after I send  a SMS its actually showed my new peremptory number to the recipient. So I ended up with so many 'Who is this' messages.

So lets fix this for iPhone 6 ( iOS 10.3.2 ) .  

1. Turn of iMesseges.

  • Settings > Messages > Switch off iMessges
2. Turn of facetime

  • Settings > Facetime > Switch off Facetime
3. Reset network settings of your iphone. After this your iphone will be restarted.

4. After you restarted the iphone switch on facetime and imessage,

 

Wednesday, April 12, 2017

Start investing in Australian Stock Exchange - ( ASX ) - Tutorial 1

Before Start Investing 

Even though this is not an IT related topic it's always best to learn something new.  So before you jump in to ASX please read following tips. These are not my ideas and they belongs to some people who are in this business and who became wealthy. I just put them together in one place for your knowledge.

1. Investing in any stock market has a risk and its greater than real estate and term deposits.

2. As a small investor ( less than 1000$ ) do not use your future savings to invest in shares or never borrow money  from a bank or friend. It's always best to save some money  from your each salary and use it for investing.

So make sure you follow above rules at first place. So you have minimised the risk of losing  your potential savings and you just avoided an unsuccessful business loan.


 Investing 

I'm using comsecc from common wealth bank as my stock broker. Its the cheapest full service broker I found  in Australia and they have very user friendly web and mobile tools. But that comes with a price of 19.90$ per trade. That means whenever you buying a stock you have to pay 19.90$ to them. Same goes with selling a stock too.

Comsecc Tip 1 -  Create your comescc acount just before you need to buy your first set of shares  as they will not charge you for your first few month trade's brokerage.  (This is an offer and I'm not sure whether they giving this offer  )


Now here are my golden tips when I'm buying shares for beginners.

1. Always buy shares of stable companies you know . ( As an example if your salary going to ANZ and you have few loans with them so you truest their business go for it. )

2. Always buy companies which are paying dividends. ( This kind of  my idea because once you get some money in every year as dividends it will make you happy  )

3. Wait for right time to buy a stock. ( Lets say you decided to buy 12 shares of CBA - Common Wealth Bank of Australia. Study the share price of CBA at-least for one month and if its 85.00$ today may be you can by it 82.00$ in 3 weeks later. Buy it at your price or at least nearest price to the price you decided  )

I think this is bit longer. So I'll come with more ASX tips for beginners with next post.



Wednesday, April 5, 2017

Cordova Camera Plugin Version 2.4.0 throwing error when building for android. - ( Guid to remove and add plugins, Maintaining your cordova project )


Even if I put specifically android in this post title may be other platforms may have this issue. The solution was simple one but I learnt many good practises and tips when I was searching for the solution.

Good practises you should follow when you working on a Cordova project

1. Update java SDK when you have a major update in java.
2. Update android SDK after every month.
3. Use updated version of Node JS.
4. Check and update your cordova version and plugin versions. ( If you using .NET and cant remove excising plugins  please follow safe plugin removal steps in this guide )


Remove plugins safely in .NET cordova project 

Sometimes dot net does not allow you to remove some of cordova plugins. In this case try to remove plugin from config.xml using xml text editor. Make sure once you remove the plugin line you also need to remove the plugin folders . Please refer following screen shots.










Problem with new camera plugin version 2.4.0

To fix this simply you will need to update you cordova-plugin-compat to version 1.1.0 which has the old version number of 1.0.0 . 

cordova-plugin-camera and cordova-plugin-geolocation are depend on compat plugin. So you may need to remvoe those two plugins before you upgrade compat plugin.




Monday, April 3, 2017

Angularjs dropdown value is not updating

Ok here is my story. I have one dropdown which is populating value from a JSON object and and it will be a number. But when you taking data from server using $http in it's success function  my drop-down did not updated.  Simply it was blank..


var httpRequest = $http({
            method: 'POST',
            url: "URL",
            data: { Params }

        }).then(
        function successCallback(response) {

            $scope.ApiServiceObject.EntityTemplateId = response.data.d.dropdownvalue;
       

        },
        function errorCallback(response) {

        });


But when I'm trying to set value to my drop-down from a integer property its not working.   So I changed bellow line and everything working fine now. 


 $scope.ApiServiceObject.EntityTemplateId = response.data.d.dropdownvalue.toString()

Thursday, March 30, 2017

Generate method stub missing visual studio 2015

In visual studio 2015 micrsoft has added few extra steps, so you can validate and edit the method or whatever code part you going to add. Please follow the following steps.

1. Right-click on the method or property name you want to add.




2. Click on Quick Actions and Refactorings.



 
3.  Edit the method or property if you need and click apply.



Wednesday, March 22, 2017

Internet explorer virtual machines by Microsoft.


For developers Microsoft has provided virtual machines with various ie versions.

https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/




Vertual Box windows vertual machines causes windows 10 blue screens



Recently I needed to test IE 9 bug in my workplace. When I tried to launch the virtual machine provided by Microsoft ( Please go to this post to get more details about microsoft internet explorer virtual machines )  but my windows 10 crashed and went to blue screen window.

After few hours of research and googling I found the problem. Its the hyper-v, the very technology that Microsoft introduce to create better virtual  machines.

So I disabled hyper-v and seems to be all good.


Disabling hyper-v


 Method 1 - Turn windows feature off in programs and features.
 Method 2 - Powershell commands


dism.exe /Online /Disable-Feature:Microsoft-Hyper-V-All

http://www.poweronplatforms.com/enable-disable-hyper-v-windows-10-8/

Operating system not found windows 10


I had this issue with my old laptop often, There are few reasons with your windows 10 OS which can cause this error message when you starting your computer.


1. You have connected USB storage to one of your USB ports. Its always a best practise remove any USB storage devices attached to your computer before turning on 

2. Disk connectivity issues.

3. Corrupted files  in OS.



Monday, March 6, 2017

Javascript and CSS caching in cordova application.



When you developing apps with cordova ( Phonegap ) you must have noticed some css and script changes is not applying to your app sometimes. You should try following things.


1. Clean your project and run again.
2. Uninstall the app in device of emulator.
3. If none of the above did not worked then delete the content inside platform folder.


Wednesday, February 8, 2017

Windows phone emulator cant access localhost.


I had this is problem when I was running my  cordova app with windows phone 8 emulator. In my case I was running my app in release mode. When I change the mode to debug I was able to access local web server from my app.


Wednesday, January 18, 2017

Remove lock from locked files in other work-spaces TFS

You can use visual studio sidekick. But its really easy to run following command on visual studio command prompt. Make sure you are running visual studio command prompt as administrator.

tf undo  /workspace:COMPUTERNAME $SERVERPATHTOFILE

Thursday, January 5, 2017

File transfer plugin not working - apche cordova, windows 10

I had this problem for weeks. It's seems to be this issue comes to me randomly for no reason. But finally I found the solution. But the reason for this problem is still hidden.

First of all it is not a problem with apache cordova or visual studio. It's windows 10 network settings. All I had to do is reset network settings of my windows 10 computer.


Search "Settings".

Click on "Network and Ethernet"

Click on "Status"

Click on "Network Reset" .

Restart your computer.





Tuesday, January 3, 2017

Convert decimal coordinates to normal readable coordinates.

Sample input ::

FieldValue = 51.467696956223364, -0.1153564453125;


function GetStringCoordinate (FieldValue) {
    if (FieldValue != null && FieldValue != undefined && FieldValue != '') {
         
        var coordinateArray = FieldValue.split(',');
        if (coordinateArray.length == 2) {
            var latFloat = parseFloat(coordinateArray[0]);
            var lngFloat = parseFloat(coordinateArray[1]);

            //latitude formatting 
            var latCh = coordinateArray[0] > 0 ? 'N' : 'S';
            var latD = Math.trunc(coordinateArray[0]);
            var latM = Math.trunc(coordinateArray[0] * 60 % 60)
            var latS = Math.trunc((Math.abs(coordinateArray[0]) * 3600) % 60)
            var latStr = latD + "° " + latM + "′ " + latS + "″ " + latCh;

            //longitude formatting 
            var lngCh = coordinateArray[1] > 0 ? 'E' : 'W';
            var lngD = Math.trunc(coordinateArray[1]);
            var lngM = Math.trunc(coordinateArray[1] * 60 % 60)
            var lngS = Math.trunc((Math.abs(coordinateArray[1]) * 3600) % 60)
            var lngStr = lngD + "° " + lngM + "′ " + lngS + "″ " + lngCh;
        }

        return latStr + ', ' + lngStr;
    }

    return '';
};