I thought I would include some screenshots here just to see the app's beginning stages! It's pretty basic, but it looks nice for now. Colors can be easily changed as well, which is nice.
On a side note, I'm still working on some searchbar issues. I've made a post on StackOverflow for now, if it can't be solved soon, I'll just check back Monday. Hopefully it can be fixed this weekend, though!
Saturday, February 28, 2015
Friday, February 27, 2015
Working with Search Results, JSON (2/27)
Today we had a lot of progress on the JSON side. We've gotten results working now! They don't display yet, since we're still working on a ListView (via JQueryMobile), but they display in console.
The reason that my JSON wasn't working is because of the fact that it wasn't loading the URL properly. We quickly found a way to fix this - it wasn't using spaces, etc. properly when loading the web page, so we used the method getURIComponent, which basically turns a string into a proper URL.
From there, JSON results were working perfectly, we can now access specific parts of the JSON [Array Books] and then individual properties of those [Book.title].
We made some changes so that it passes a function when XHR loads, so that we're not having issues with null JSON (we weren't able to get it perfectly from the URL after some testing). Hopefully, it'll work perfectly, although it'll still require some major testing.
The reason that my JSON wasn't working is because of the fact that it wasn't loading the URL properly. We quickly found a way to fix this - it wasn't using spaces, etc. properly when loading the web page, so we used the method getURIComponent, which basically turns a string into a proper URL.
From there, JSON results were working perfectly, we can now access specific parts of the JSON [Array Books] and then individual properties of those [Book.title].
We made some changes so that it passes a function when XHR loads, so that we're not having issues with null JSON (we weren't able to get it perfectly from the URL after some testing). Hopefully, it'll work perfectly, although it'll still require some major testing.
Thursday, February 26, 2015
Working on Savable Settings (2/26)
I know it was a snow day, but I felt the need to at least put some time towards LibriFox. I felt as if there was a lot of stuff that we were so close to creating, and so I decided to work on it a bit!
Today, I accomplished something I find important: savable settings.
We already have JSON and search functionality will hopefully come tomorrow, so I did some research into how I could get the settings to save, and return as soon as a user comes back in the app.
At first, I messed around with creating files manually. I couldn't find anything on Mozilla's website about savable settings (maybe I didn't look enough?) so I worked on some very large and complicated methods to do it for me. I was able to get settings to save, but I couldn't add settings to the file. I tried help from various websites. I was ending up in the same place every time, the FileHandle API. Which, I now understand, but I don't really need it [yet].
I then did some more research and found that it was a lot more simpler. In fact, it's just a single line. This line involves a variable called localStorage, which looks like it's pretty much on every app - however I include checks to make sure it exists in my methods to make sure the file is saving.
LocalStorage defines the settings file. You basically just code:
localStorage.setItem(key, value)
And the settings are saved. You can later go back:
localStorage.getValue(key)
And get the value of any key you have previously set.
Here's my two usable methods that I have tested:
function writeToSettings(key, value){ // Writes a key, value pair to settings
if(window.localStorage){
localStorage.setItem(key, value);
}
}
function getValue(key){ // Gets a value based on a key provided
if(window.localStorage){
localStorage.getItem(key);
}
}
However, I'm currently having an issue as to it not saving when the app closes. I'll look into this more tomorrow.
Today, I accomplished something I find important: savable settings.
We already have JSON and search functionality will hopefully come tomorrow, so I did some research into how I could get the settings to save, and return as soon as a user comes back in the app.
At first, I messed around with creating files manually. I couldn't find anything on Mozilla's website about savable settings (maybe I didn't look enough?) so I worked on some very large and complicated methods to do it for me. I was able to get settings to save, but I couldn't add settings to the file. I tried help from various websites. I was ending up in the same place every time, the FileHandle API. Which, I now understand, but I don't really need it [yet].
I then did some more research and found that it was a lot more simpler. In fact, it's just a single line. This line involves a variable called localStorage, which looks like it's pretty much on every app - however I include checks to make sure it exists in my methods to make sure the file is saving.
LocalStorage defines the settings file. You basically just code:
localStorage.setItem(key, value)
And the settings are saved. You can later go back:
localStorage.getValue(key)
And get the value of any key you have previously set.
Here's my two usable methods that I have tested:
function writeToSettings(key, value){ // Writes a key, value pair to settings
if(window.localStorage){
localStorage.setItem(key, value);
}
}
function getValue(key){ // Gets a value based on a key provided
if(window.localStorage){
localStorage.getItem(key);
}
}
However, I'm currently having an issue as to it not saving when the app closes. I'll look into this more tomorrow.
Wednesday, February 25, 2015
Searchbar Functionality, Blog Changes, and Themes (2/25)
To start out, I fixed some things with this blog today. New title and new GitHub link (on the right!).
I also added searchbar functionality with JQuery. It took a lot of googling, but I finally found a StackOverflow post with a person with the similar issue. Instead of calling the text() method of my searchbar, it was the var() method that I needed to call. Now, I have a searchbar that calls a method when the user presses enter, and the text that is inputted is stored in a variable for searching! Once Alex figures out how to use JSON requests with permissions, we should have a stable first release.
I also started looking around for themes. I really want to use the Graphite theme in blue. I think it matches the LibriVox's colors best, and I also believe that it looks clean and simplistic. Sadly, I've figured out that this theme was abandoned years ago, so it looks as if we're going to have to do another theme.
So, I decided to make my own theme. I started out with some help from Aki; we created a header and a div that created a menu-like theme, using data-role. I then created buttons to go to a settings menu, created a new settings.html page, and then buttons to go from the settings menu back to home. I tested the button and it works great, and looks nice as well! Alex got the JSON working, so an early version might be possible by tomorrow! It had to do with app permissions, and a few lines fixed it.
I worked on a volume slider as well. As we're working with audiobooks, this function is key for our app. I'm still working on getting its value, but I'm pretty close to that - so volume should be working tomorrow as well, provided we can get permissions working!
I also added searchbar functionality with JQuery. It took a lot of googling, but I finally found a StackOverflow post with a person with the similar issue. Instead of calling the text() method of my searchbar, it was the var() method that I needed to call. Now, I have a searchbar that calls a method when the user presses enter, and the text that is inputted is stored in a variable for searching! Once Alex figures out how to use JSON requests with permissions, we should have a stable first release.
I also started looking around for themes. I really want to use the Graphite theme in blue. I think it matches the LibriVox's colors best, and I also believe that it looks clean and simplistic. Sadly, I've figured out that this theme was abandoned years ago, so it looks as if we're going to have to do another theme.
So, I decided to make my own theme. I started out with some help from Aki; we created a header and a div that created a menu-like theme, using data-role. I then created buttons to go to a settings menu, created a new settings.html page, and then buttons to go from the settings menu back to home. I tested the button and it works great, and looks nice as well! Alex got the JSON working, so an early version might be possible by tomorrow! It had to do with app permissions, and a few lines fixed it.
I worked on a volume slider as well. As we're working with audiobooks, this function is key for our app. I'm still working on getting its value, but I'm pretty close to that - so volume should be working tomorrow as well, provided we can get permissions working!
Tuesday, February 24, 2015
GitHub issues and some progress (2/24)
Today we setup a basic GitHub repo such that we can both push into the same repository. However, we're working on setting up a better situation - currently, our app is very small and doesn't have much code. As a result, we have to manually merge lines, line-by-line. Hopefully we'll find a solution tomorrow.
I also made a search bar :)
I know it's not too much, it was just a first test. It also has a function that's called when the user searches. I'm working on getting it's input, and then searching through the database.
JSON is also having some issues with accessing the database and Content Security Policy. We'll work a bit more on that tomorrow as well.
I also made a search bar :)
I know it's not too much, it was just a first test. It also has a function that's called when the user searches. I'm working on getting it's input, and then searching through the database.
JSON is also having some issues with accessing the database and Content Security Policy. We'll work a bit more on that tomorrow as well.
Friday, February 20, 2015
Switching from "Download Failed" to "Download Stopped" (2/20)
Well, I guess I made some progress.
At the beginning of this period, I was having issues with a "download failed" error. I found this post on StackOverflow, which said that it was a result of a manifest error. I then found a place on Mozilla's website where I could check the manifest. Slowly, I removed all the errors from it, and now my packaged app has no errors according to their website here. (I uploaded the .zip every time I wanted to check for errors)
Now, both Alex and I are facing another issue: "Download Stopped". Once again, it's the same process, although now our manifests are perfect, and our .zip files are also perfect, according to their checker. I'm still experimenting with different possibilities of removing this, such as different ways of zipping the file, etc., but nothing is working so far. This time, there is no information on Google as of yet. I'm just getting directed to StackOverflow posts from the "Download Failed" issue. While it could be OS-based, I'm thinking that it has something to do with how our packages are compressed or the file structure of our apps.
I'll continue trying; hopefully I can solve this issue soon!
At the beginning of this period, I was having issues with a "download failed" error. I found this post on StackOverflow, which said that it was a result of a manifest error. I then found a place on Mozilla's website where I could check the manifest. Slowly, I removed all the errors from it, and now my packaged app has no errors according to their website here. (I uploaded the .zip every time I wanted to check for errors)
Now, both Alex and I are facing another issue: "Download Stopped". Once again, it's the same process, although now our manifests are perfect, and our .zip files are also perfect, according to their checker. I'm still experimenting with different possibilities of removing this, such as different ways of zipping the file, etc., but nothing is working so far. This time, there is no information on Google as of yet. I'm just getting directed to StackOverflow posts from the "Download Failed" issue. While it could be OS-based, I'm thinking that it has something to do with how our packages are compressed or the file structure of our apps.
I'll continue trying; hopefully I can solve this issue soon!
Thursday, February 19, 2015
Working with installation of the app (2/19)
Today I attempted to self-host and self-publish the app. Although the instructions to do so looked very simple, it turned out to be a very difficult process.
Alex and I tried as many options as we could think of. I decided to start by self-hosting the app on the students server, so it's now there in zipped format. We installed a manifest file, as well as an index file that triggers the installation. We've gotten to the point where the user can accept the install. The device even says that the install succeeds. However, once it downloads the file, it quickly fails, and there's no way to check exactly why the errors are occurring. I checked ADB and the console in the WebIDE, and there's no display of the error, no logs at all.
To back up a bit and go over the basics:
There's two options for the install: install and installPackage. Both would be run in <script> tags in the index.html file. We are going with installPackage, since our app is a self-hosted, self-published app. If it was a simple webapp, it'd be install. However, the install method is installing the app, but when we click on it, it's redirecting us to the students.gctaa.net homepage...
I guess I'll try more options tomorrow. Hopefully, it'll work, but it will definitely take a lot more trial and error!
Alex and I tried as many options as we could think of. I decided to start by self-hosting the app on the students server, so it's now there in zipped format. We installed a manifest file, as well as an index file that triggers the installation. We've gotten to the point where the user can accept the install. The device even says that the install succeeds. However, once it downloads the file, it quickly fails, and there's no way to check exactly why the errors are occurring. I checked ADB and the console in the WebIDE, and there's no display of the error, no logs at all.
To back up a bit and go over the basics:
- There's an index file, index.html, which executes the script to install the app
- There's an app mini-manifest file, which defines the name and hosted file location of the app, and
- There's a .zip file of the app and all of its source, including a full manifest file
There's two options for the install: install and installPackage. Both would be run in <script> tags in the index.html file. We are going with installPackage, since our app is a self-hosted, self-published app. If it was a simple webapp, it'd be install. However, the install method is installing the app, but when we click on it, it's redirecting us to the students.gctaa.net homepage...
I guess I'll try more options tomorrow. Hopefully, it'll work, but it will definitely take a lot more trial and error!
Subscribe to:
Posts (Atom)

