Posted in Mobile_Tips, Useful Apps

[App] JLT Free – Mobile app provide a huge of Japanese tests for learners

 

jlt_icon

JLT – Japanese Language Test is a Mobile application which provide a lot of Test data for learner on N1, N2, N3, N4, N5 levels.

–          It is FREE

–          Easy to use, UI is very friendly.

–          It provice a lot of Japanese tests.

–          Test Result Analysis is clear.

–          Daily update.

How to download for Android ?

–          Way 1: Open “Google Play” on your mobile and search “JLT Free”, then install it.

–          Way 2: Get it from link: https://play.google.com/store/apps/details?id=com.saothienhat.jltfree&hl=en

Advertisements
Posted in Uncategorized

[Cordova] How to preview PDF file inside Cordova project

cordova_logo

Hi all, I faced this challenge for my tasks list. After searching a lot on Internet with various solutions:

  • Using InAppBrower: this plugin can open PDF for preview but it will open a certain PDF reader application on device not inside our Cordova project
  • PDFObject: hmmm, I tried use it but I faced compile error about import it into my project, I did not fix that issue because of time limitation.

Finally, I found the solution which solved my challenge 🙂 (it saved my life 🙂 ).

Below is result:

screenshot_2016-10-18-14-25-43

About the detail, please follow steps of the “example” at my github

I preferred that solution at sayanee’s github. Thank him very much 🙂

You also install that plugin by npm (Ref detail at here):

npm install angular-pdf

Hope it is helpful 🙂

Posted in Cordova/PhoneGap

[Cordova] How to download a file

cordova_logo

To download a file from given URL, we need the cordova-plugin-file-transfer plugin. You also install this plugin by command:

cordova plugin add cordova-plugin-file-transfer

Then, use below code:

 function downloadFile(downloadedFileName, downloadLink) {

var fileURL;
if (monaca.isAndroid === true) {
var androidDownloadPath = ‘/storage/emulated/0/path/to/’;
fileURL = androidDownloadPath + downloadedFileName;
} else {
var iosDownloadPath = cordova.file.documentsDirectory;
fileURL = iosDownloadPath + downloadedFileName;
}
var uri = encodeURI(downloadLink);
processDownloadFile(uri, fileURL);

}

function processDownloadFile(uri, fileURL) {
var encodedFileURL = encodeURI(fileURL);
var fileTransfer = new FileTransfer();
fileTransfer.download(
uri,
encodedFileURL,
function(entry) {
console.log(“Download complete ! Place of downloaded file: ” + entry.toURL() + ” – Source: ” + uri);
},
function(error) {
console.error(“error source ” + error.source + ” – download error target ” + error.target + ” – upload error code” + error.code);
},
false, {
headers: {
“Authorization”: “Basic false headers”
}
}
);
}

Posted in Android Programming, Cordova/PhoneGap, iOS Programming, Mobile_Tips

[Cordova] Tips: How to delete a file

cordova_logo

Actually, it is very easy and simple because you can use the cordova-plugin-file

You can download the file plugin with command:

cordova plugin add cordova-plugin-file

Demo code:

var path = "file:///storage/emulated/0";
var filename = "myfile.txt";

window.resolveLocalFileSystemURL(path, function(dir) {
	dir.getFile(filename, {create:false}, function(fileEntry) {
              fileEntry.remove(function(){
                  // The file has been removed succesfully
              },function(error){
                  // Error deleting the file
              },function(){
                 // The file doesn't exist
              });
	});
});

Hope it is useful🙂

Posted in Cordova/PhoneGap

How create Android using Ionic + Cordova + Android Studio

If you want to create an Android application using Ionic + Cordova + Android Studio. You can refer below steps:

– Step 1: open “Git Bash” application

Featured image

– Step 2: run command: ionic start <app_name> <app_type> .Example: ionic start myApp sidemenu

Featured image
– Step 3: move tp <app_name> folder and add android/ios platform for it by command: “ionic platform add <android/ios>”. Example: ionic platform add android
– Step 4: build project by command: ionic build <android/ios> . Example: ionic build android
– Step 5: open the project by Android Studio (open not import)

Featured image

– Step 6: configure for run app

Featured image

Featured image

Featured image

  • Result on Brower:

Step_Result_on_Brower

You can refer this link for other reference.

Hope this help :).