I have a KML file and I want to extract certain portion of the file only. I am mainly interested in the coordinates of a line path.
Since I am using Java, there is an API which one can use to do the parsing. It is JSoup. You can download the library here. However, since I’m using Android Studio, I just included it in my build.gradle module file.
Sync the project afterwards.
If you want to include Google Maps in your Android app and you are using Android Studio, just follow the simple steps below:
1. In your SDK Manager, make sure that the Google Play Services is installed.
2. Next is to get the SHA1 key needed for the registration of the app to Google’s Developer Console.
In the command line, issue the following command for Windows:
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
I am not sure what it does, I just read it from the documentation. For other operation systems, check the documentation (see the debug certificate). If you cannot find the keytool program, it is located under the bin directory of your JDK folder. Continue reading
I came across one post in Facebook this morning where a user posted a question on how to convert numbers into words. I tried solving the problem and here is my solution.
The program is limited to representing numbers in Trillions. Although you can modify the program to support even bigger numbers by simply adding another value in the array. Continue reading
I have an assignment in my Networks class which involves analyzing the performance of three different network topology, namely: flat, tree and layered. Below are the diagrams which represent the different network setup.
H0 is the server while H1 to H5 are all clients.
Flat Network Setup
Tree Network Setup
Layered Network Setup
The task was to write a script that would allow all the hosts (H1-H5) to simultaneously ping the server (H0). Afterwards measure the average delay. Each link has a bandwidth of 10Mbps, delay of 5ms and 0% packet loss. Continue reading
I am trying to define my own Network class that computes for the following values:
- Network address
- Broadcast address
- First and last valid host addresses
- Subnet the network given the number of required networks
The following is the class diagram of the class:
If you want to disable directory listing in apache, you can issue the following command:
sudo a2dismod autoindex
Afterwards, restart the service:
sudo service apache2 restart
This forces the server to look for the index file (like index.html or index.php). If it cannot find it, it returns an HTTP 404.
For some weird reason, I can’t start my Apache web service on my server. My server runs on Ubuntu Server. I tried to remove, purge and re-install the apache2 package. Still, the problem persisted.
My theory is that I installed apache2 before and removed it. Whenever I try to issue the following command:
sudo service apache2 start
I get this error message:
apache2: unrecognized service
Ubuntu will tell me that apache2 is an unrecognized service although I know apache2 was installed. After inspecting the /etc/init.d directory, the apache2 command was actually missing.
Re-installing with the simple apt-get remove and install will not work based on my experience. After searching for some answers in the forums, I came across this command:
sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2.2-common
I am not sure what it completely means but I guess it forces Ubuntu to re-install all the files and re-install the common files of apache2. After issuing this command, my apache2 command under the /etc/init.d directory came back.
It worked for me. Reference here.
If you are developing an Android app and you want to use AdMob, you can just follow the steps in this page.
However, what I noticed is that after including AdMob in the application, the APK grew tremendously. I came across one forum and one way to shrink the application size is modifying the gradle.build (module level).
into this one:
This will save you around 600 KB.
As I was trying to upload my app in the Google Play Store, I encountered the following error:
The error has got something to do with the version code of the APK I was uploading. I tried searching the Internet for answers and found out that I have to specify the version code inside the Android Manifest file. It has to be different from what is already in the Play Store (usually increment).
However, I still got the same error after generating the signed APK. Later I found out that if you are using Android Studio, you should modify the build.gradle (module level). You specify the version code there:
The version code does not necessarily mean the major revision version number. It should always be a whole number. If you only have a minor revision, you can specify it in the version name.
I was able to manage to create a simple network subnet calculator app for Android. I am still learning Android programming.
I used Android Studio as my IDE to develop the app.
Here are some screenshots:
This is where the user provides the needed information for the calculator to work. Continue reading