Blog

Filtering all blogs tagged as "phonegap."    Clear filter

Base64, FileOperations and BackgroundJS PhoneGap Plugins Now Available On PhoneGap Build

BadrIT continues its contribution to the open source community with the publish of Base64, FileOperations and BackgroundJS plugins on the official PhoneGap Build plugins repository.

Base64

Base64 is a plugin used to encode any file to Base64 gaining the advantage of native performance to handle the computations.

 

BackgroundJS

BackgroundJS is a plugin used to allow running background javascript code operation on iOS.

 

FileOperations

FileOperations is a plugin used to copy and delete files using native code in Android and PhoneGap FileTransfer object on iOS.

Why not FileTransfer plugin for Android? Because it is not implemented to handle large size files. If file size is large, the app will suffer from crashes during transfer operations.

Read More

Retrieve MAC Address With MacAddress PhoneGap Plugin

BadrIT continues its contribution to the open source community with the publish of MacAddress plugin on the official PhoneGap Build plugins repository.

MacAddress is a plugin used to retrieve native MacAddress for Android/iOS devices.

 

Read More

Printing PhoneGap Plugin Now Published on PhoneGap Build

Printing to network printer, using Google Cloud Printing or Apple AirPrint, is now made easy using  PrintPlugin that was developed by BadrIT published on the official PhoneGap Build plugins repository. 

PrintPlugin is a plugin for iOS and Android that enables application developer to print HTML content  using AirPrint for iOS and Google Cloud Print for Android (see screen shots below).

 

  

Read More

EmailComposer PhoneGap Plugin Now Published on PhoneGap Build

BadrIT continues its contribution to the open source community with the publish of EmailComposer plugin on the official PhoneGap Build plugins repository.

EmailComposer is a plugin for iOS and Android that enables application developer to send HTML email including attachments by invoking the native widget provided by the operating system.

 

Read More

JavaScript Equals Operator (==) Pitfalls

JavaScript has two equality comparison operators == and ===. Let's see what is the difference between them in the following tables:

== true false 1 0 "1" "0" null "JS" "" NaN Infinity
true  true  false true false true false false false false false false
false   true false true false true false false true false false
1
  true false true false false false false false false
0       true false true false false true false false
"1"         true false false false false false false
"0"           true false false false false false
null             true false false false false
"JS"               true false false false
""                 true false false
NaN                   false false
Infinity

 

                  true

== comparison chart 

 

=== true false 1 0 "1" "0" null "JS" "" NaN Infinity
true  true false false false false false false false false false false
false   true false false false false false false false false false
1     true false false false false false false false false
0       true false false false false false false false
"1"         true false false false false false false
"0"           true false false false false false
null             true false false false false
"JS"               true false false false
""                 true false false
NaN                   false false
Infinity                     true

 === comparison chart

As you can see, the first table contains several unexpected behaviors, such as "1" == true and "" == 0 !

On the other hand, the second table looks prefectly as expected.

So, you should always use === for maintanabie code. The same also applies to != and !== operators. For NaN and Infinity checking, you should use isNaN() and isFinite() functions.

Read More
« Previous Entries