Posts

Showing posts with the label Android

MyPatco Roadmap for 2017

   If you have been following updates on mypatco's twitter account then you know that there has been a lot of updates since the initial release of mypatco. Now what I want to do is make plans for whats lays ahead for this project which I've been spot on for getting things do so far.  The highest on my list is finishing the ios app. The second is the app indexing because I think it will greatly help the app's grow faster than it currently is, which isn't bad but just simply improve out of interest. The end goal of this app is to become the number one app for patco and provide a great user experience for patco users even if I no longer use it. Third update is more straight forward and almost done. Just display the messages in the email as alerts on the mobile devices. The feature I would like to add to this requires a little oversight on my part but ultimately become  a tool for me to perform quick group updates for schedules on the fly. This is one way I see it and ano…

Material Angular Time Picker

Image
    Continuing off my article on android's material timepickers I wanted to include this feature in the web based version of mypatco. I don't think it will be officially included in the material angular project but just something I could have as my own and if anyone comes across it to use it just as any other component. The key difference with timepickers vs. datepicker just picking time, since time is a more necessary feature for cases like notifications or alerts/alarms.



First and foremost I recommend checking out the project which I forked to personalize and strip out any code related to datepicker. Since the datepicker is already implemented in material angular, instead I'm just going to focus on time pickers.  The rest of my notes are in the repo's issue tracking. You may see the results on mypatco.org for an example.

Android: Retrieving SHA1 key for Firebase on Windows

    If you using firebase and want to debug for Oauth or Messaging you will need to add a certificate SHA1 from your app key. You might need it for other features but this is what I'm sure about. Assuming java is installed then wherever you java is installed is where you will need to point to for 
Example of File location C:\Program Files (x86)\Java\jre1.8.0_60\bin

Command"keytool -exportcert -list -v -alias "YOURALIAS"  -keystore YOURKEYFILE.jks > file.txt" 
I would output to a file so you can copy it later...

Resources
Authenticating Your Client

My Patco Now Runs on Firebase

   Over the past two months I've do to made a critical decision due to costs and completely redid the backend for mypatco. Of course there was breaking changes but that wasn't related to the bad reviews that came in (caused by another developer). Instead of using azure now the app is hosted on firebase which everything I need starts out for free.

Key Features

Free HttpsLater needed for GeolocationsFree use of Custom Domain *Databasing (real-time)Json type database greatly reduces time for developing with api'sStatic HostingPlugins for Angular with DatabaseAuthentication The first two really sold me on the idea but the static hosting had me worried since a lot of my data was handle at the middle tier level. Pretty soon though I had my data flatten and it just made sense but the process of updating my database is still in the works luckily though not all my code had to be scraped. To get the database corrected I still have my azure code to handle this but it runs on a project…

Firebase Realtime Data - "setPersistenceEnabled() must be made before any other usage"

    Just a small issue I encountered with my android app with how to correctly implement firebase real time data to be persistent. I did found a few notices on how to correct this and most of them was just making the database instance static or with a flag to see if the object wasn't already created. A better solution would be having the later version of the object handle this in a method. What I did was just wrap it with my own object and create a method like its explained in the github issue. The purpose of this post is really just make the information more available and public so the documents get updated or the code get addressed.

Code
public class FirebaseUtil { private static FirebaseDatabase mDatabase; public static FirebaseDatabase getDatabase() { if (mDatabase == null) { mDatabase = FirebaseDatabase.getInstance(); mDatabase.setPersistenceEnabled(true); } return mDatabase; } }

Usage
DatabaseReference myRef = Fireb…

My Patco - Version 14

    My goal for the support of "My Patco" is to create updates every once a month, and have the schedule automated from here on out. I think for the next few months I will need to validate most of my work but for the most part the updates coming in the end of this should really start to be stable. Initially I created the database around google's train system standard however looking things from a direct approach this approach doesn't need the same level of architecture. In fact it hurts me because I'm constantly looking for things and need to join tables just to query a single schedule. I could probably do it all with just two parameters.
   For I'm aiming to finishing this version up which requires some work on the backend more than the app but users should see the app respond a lot faster. I know there was a bug when I released but had to meet my deadline or else I would just keep pushing it back. Things like that can happen a lot if your just doing it for…

Make Android studio behave like Visual Studio

    I really enjoy using Android Studio compared to eclipse, a years ago I would be frustrated looking for things but now days this isn't the case. With my job I need to use Visual Studio and over the course of five years I think I've mastered most of the hotkeys. The transition isn't too much difficult between the two but it can get annoying with the hotkeys. Also I want to say love look of both IDE's so other than functionality the two are awesome tools to work with.

Prevent Last Project from Auto Opening
   I sometimes forget what my last project even was, thankfully its a simple to fix. Open your Setting and under General remove the check for "Reopen last project on startup" and you're done!

Prevent Auto Gradle Running
 This really slow things down when starting up. If its know working project doesn't make sense to just waste time processing. I'm talking about projects where the dependencies are already included.

Disable Gradle auto make in Andro…

Retrofit Callback instead of Async Handler

   For a quick and dirty solution I used an async handler in my activity, to call an api. I sometime need to see things work right for a sanity check, and win whatever small achievement it holds. Whether its just to reassure me I'm on the right path. So below is a quick and simple change but makes all the difference.

@GET("/GetTimes/{id}")public ArrayList<YourObject> GrabData(@Path("id") String id);vs
@GET("/GetTimes/{id}")
void GrabData(@Path("id") String id, Callback<ArrayList<YourObject>> callback);

Resources
using Square's Retrofit networking library
Retrofit.Callback's success() and failure()
If you callback is in a fragment
Receiving custom parameter in retrofit callback

Installing Android Studio Beta 0.8.14 exe

Image
    This week I installed android studio however but I didn't want manually install it and to use the zip file. So looked for the appropriate exe file (if there was any). In the recent notes there is explanation on why the zip version pointed the download link. I installed v.0.8.14 but I pretty sure I wasn't paying attention because there is later versions available. Infact the release Candidate 4 was updated just yesterday but v0.8.14 is what's currently listed on the downloads


Notes (v.0.8.14) 
after my install for android studio, prompted to startup the application but got that jvm missing error. When I ran the application myself and it worked fine. Also the icon is different for the program in the taskbar from the zip to the exe file.After running both the zip and the exe files, both made a configuration in the user's folder but only one of them was called beta. After pinning the program to the taskbar, the program duplicated itself. I then tried to unpin it and p…

Android Studio 'tools.jar' file is not present in classpath

Image
     I move around from machine to machine a lot and this is an issue hidden in another form. The error doesn't really help but it is clear something is missing. Two things that I was missing was the correct file path to my sdk and didn't the JRE included/installed.

Things to make sure you always do
install the JDK and JREinstall the version you want 64 or 32 bitsometimes I install both just to be safe but I don't like to do that.create the environment path JAVA_HOMEsometimes the installer doesn't create this...path (64 bit) should be something like..  C:\Program Files\Java\jdk1.8.0_25     Right click on the window icon in the right and go to systems (advanced settings).

Noteshttps://www.java.com/en/ - Does not include the JRE.http://www.oracle.com/technetwork/java/javase/downloads/index.html
Resources
ide - Android Studio 'tools.jar' file is not present in classpath - Stack Overflow - Linux help
Getting Started with Auto | Android Developers
How to set the java path…

Galaxy S Fascinate SCH-I500 Notes

Nexus 7 Not Appearing Over the USB

Image
    This should have been a easy setup but since I ran into a few problems that weren't simple nor obvious I thought I would share and record my notes. For much of my android development I use the ADT Bungle for Windows, I have the Android Studio Development but just playing out with it. Regardless the problem with my setup was my Nexus 7 not appearing. At this point I had already gotten the debugger mode enabled and the usb connected but still 'adb' is not seeing my device.
     Simply put the Nexus 7 by default (for me at least) was set to MTP and if you can see the connection mode notification can change it from there to PTP. The notification for me appeared briefly, so what I did was have the notification bar open as I plugged in my nexus.



The first link you below holds the location where to install drivers for your windows setup which you might need to know for when you switch from MTP to PTP, but the last link is the most important. The two others are just a little…

HTML5 Audio doesn't Autoplay for Chrome on Android

    Recently I was playing Penguins Rising on my nexus 7 and notice that the background music wasn't playing but strangely all the other sounds were. After a hard look at the code, I found no reason for the audio not to be work. So I could tell right away this wasn't going to be an easy fix. The first thing I did was check the support to see if  the HTML5 audio element had any support issues. Since the support for the audio element seemed to be alright with what I was using, the next thing I thought was that it must be the attribute autoplay. Its important to note that I am also using the loop attribute but I will return to that later.

Example from Penguins Rising
<audioautoplayloop><sourcesrc="content/ArcticWind.wav"type="audio/wav"><sourcesrc="content/ArcticWind.ogg"type="audio/ogg"><sourcesrc="mp3/ArcticWind.mp3"type="audio/mpeg"></audio>
Currently I have for my solution is to simply st…

Using TFS with Eclipse

Image
This article is from the experience I gain while setting out to complete my capstone and a point in time where I was exploring that ways to manage a team. I also wanted to help move things forward with the process for the team to code rather than spending more time on design. My capstone was along the side with three other colleagues and we did not all have the same idea with what systems or tools should be in place to help us achieve our tasks. Still after the fourth change of repository system in my team, I figured it was time that I took charge and started making changes for the better with my suggestion to use TFS.

Plugin: TFS Plug-in for Eclipse | Eclipse Plugins, Bundles and Products - Eclipse Marketplace


The following plugin behaves much like the native built-in tool for visual studio but with a slight twist for the  tab locations because of how eclipse is setup. At first when I started researching this plugin and testing it for for our android project I had worries of whether …