JavaScript last day of the month

by DeanLogic Z30

I usually don’t do post about simple JavaScript issues, but I figured I might need this solution again and might as well write it down.

I am working on a new product called Archibus Web Central. Basically it is a building inventory management tool. The application is made up of an XML and JavaScript Hybrid code. Poor explanation, but not really important to this post.

In the project I am working on, I need to determine a start and end date in order to get a range of dates. To make my life simple, I am just using a set of drop lists with months and years as options. After the start and end values are collected, I want to set the date range to the 1st day of the month for the start selection and the last day of the month for the end selection.

i.e. August 2014 gives me 08/01/2014 if it is the start and 08/31/2014 if it is the end.

Well, since JavaScript doesn’t have a LastDay() function, I need to calculate what is the last day. And, since months are different and leap year and such, I can’t simply just put 30 as the Day in the Date object. The key is to get the next month and subtract from there.


//get the drop lists and the selected values

var eYear = document.getElementById('endYearList');

var eYearValue = eYear.options[eYear.selectedIndex].value;

var eMonth = document.getElementById('endMonthList');

var eMonthValue = eMonth.options[eMonth.selectedIndex].value;

//create the Date object

var endDate = new Date(eYearValue,eMonthValue ,1,0,0,0,0);

//create the Date object that will provide the Day value

var endDateDate = new Date(endDate).setMonth() + 1);

//set the Day with the endDateDate

endDate.setDate(new Date(endDateDate - 1).getDate)):

It might not be the smallest or best code, but at least I know that it provides the correct value.

Built for BlackBerry

by DeanLogic Z30

built_for_blackberry_10_logo_black_rgbJust because you build an app to run on a BlackBerry device, doesn’t mean that it is Built for BlackBerry. There are guidelines for what is considered Built for BlackBerry. And after you think you have done your best to meet those guidelines, you have to submit your app to be scrutinized by someone from BlackBerry to determine if you did meet those guidelines. On top of that, you only get a limited number of tries to get the app passed.

Built for BlackBerry. The signature BlackBerry 10 experience. Built to keep you moving, apps and games with the Built for BlackBerry designation provide the seamless performance and integrated experience you’ve come to love. Look for the Built for BlackBerry badge to identify apps and games that deliver the signature BlackBerry 10 experience

Well, after two tries, Meetup for BlackBerry 10 by DeanLogic is now officially a Built for BlackBerry app. The best part is that I don’t have to do anything to my app page, it gets a sticker automagically.

Meetup for BlackBerry Built for BlackBerry

But, there is still more work to be done on the app.

Meetup for BlackBerry 1.2.2

by DeanLogic Z30

Meetup for BlackBerry 10 iconMeetup for BlackBerry 10 by DeanLogic version 1.2.2 is now available for download.

The first thing you should notice is that the install size is now only 1.5 MB. Sorry for making it so huge before, I didn’t realize the splash screen images were the culprit.

The other obvious change is the app icon. Due to a request from Meetup, I modified the logo to meet their requirements.

I added shortcut keys for the Q and Passport, but found out that the ‘Alt’ key won’t work for those shortcuts. I will do a different shortcut and send out an update.

I added the ability to reply to Chat in an Event. This is not the same as the new Message feature Meetup added.

There were plans to add Group Search and Join, but it was taking a while to get the questions/profile page working and now Meetup has made that a required part of joining a group. I will continue to work on that and hopefully get that out soon.

Chat Reply 1 Chat Reply 2 Chat Reply 3

*** bug fixes ***

  • Fixed issue with splash screen and other image sizes, which was causing the app to be a much larger size than it should have been
  • Fixed progress and status indicators on Authentication and Feed screens
  • Albums refresh was not working
  • Fixed issue with Latitude and Longitude not providing correct location when mapping an event
  • Changed icon and splash screens in accordance with Meetup guidelines for logo useage

*** features ***

  • Added settings feature to clear user authentication to allow user to log in as a different user.
  • Added lower case “L” keyboard shortcut to “reload” Activity, Groups, Events and Albums
  • Added “Alt + f” keyboard shortcut to change focused tab to Feed on main screen
  • Added “Alt + g” keyboard shortcut to change focused tab to Groups on main screen
  • Added “Alt + e” keyboard shortcut to change focused tab to Events on main screen
  • Added Chat on Event and Reply to Chat on Event

 

Images, app size and the Splash Screen

by DeanLogic

A little while ago, Crackberry.com did a review for the Meetup for BlackBerry 10 app.  No, not my Meetup for BlackBerry 10 app, but an app by someone else.  I know I haven’t worked a lot on my app, but it was a bit annoying to see a review for the app and have the reviewer claim that an app for Meetup was finally in BlackBerry App World, when I release my app almost an entire year earlier. I informed the app developer that I already had the app name and he changed his name.  However, a couple of things happened during this duplicate app review.  The first being that someone gave my app a bad review due to the file size.  The other thing that happened is that apparently Meetup finally noticed my app and made me change my logo.  Fortunately, I guess, changing my logo for Meetup has actually solved the issue of the file size of my app.

Old Meetup Splash ScreenFor each type of device, BlackBerry has a different Splash Screen.  The Splash Screen is the image that a user sees as the app is first opened on the device.  The Splash Screen images are stored as assets in the application. Possibly, a developer could create a new build for each device and only store the appropriate logo and Splash Screen for that particular device bar file.  That would probably get a little tedious and is prone to mistakes.  Another option is to create just a minimum number of Splash Screens and let the device resize the image.  This option might not be the best idea, because if you don’t have an image that the device recognizes, then you won’t have a Splash Screen at all.  I personally figured it was best to create a screen for each device (landscape and portrait views), because there might be slight modifications to the different images and I want to make my app feel like it was made for each device, not just crammed into the appropriate size.

I had initially tried to be fancy and found a great image of black leather to use as my background for the Splash Screen. Then I added the Meetup logo, the BlackBerry logo and my DeanLogic logo.  Each of the first two logos weren’t very fancy, but my DeanLogic logo had a bit of detail.  Then I added some text and other items to complete the Splash Screen.  When I finished making the all the images and compiled my app, I ended up with a 24 MB(23,446KB) app.  I had left the app that size for few months, until that bad review.  Oops!  PNG save types

As I tried to fix this issue, I was driving myself crazy trying to figure out why it was so large, since I felt there wasn’t a lot to the app.  The images didn’t seem to be very big and I figured that when everything was zipped up into a bar file, it would reduce the overall size, but it seemed to double the size of the app. I started messing around with the image and found that I was saving the export files in PNG 32.  Well, that made the image file much larger than my final choice of PNG 8. There wasn’t anything noticeable in the image quality.   My app size was cut down to 9 MB(8,977 KB).  Yeah…. well, it was still a bit large.

Then Meetup came along with their request to change the logo.

We also want to confirm that you will not use our trademark ‘Meetup’ to refer to your app, but instead be using the full name ‘Meetup by Dean Logic’ in all of the places where you refer to your app, in both logo and text. This includes the copy in the BlackBerry World store and any other places where the app is promoted. To clarify, the ‘Meetup’ trademark can be used when referring to our platform or our API, but the use of our trademark is not permitted when our API is not being used and ‘Meetup’ can generally not be used in the name of an outside developer’s app.

Uh…okay.

I also had to change my app description to reflect that it wasn’t an official Meetup app.

Meetup Inc. does not endorse or sponsor Meetup for BlackBerry 10 by DeanLogic, and we are not affiliated with Meetup Inc. If you have any questions or issues about the app, there is a “Feedback/Support” form in the app settings menu for contacting DeanLogic support. If you have any questions or issues about Meetup site, got to Meetup.com.

Meetup helps groups of people with shared interests plan events and facilitates off line group meetings in various localities around the world. More than 9,000 groups get together in local communities each day.

The app description change was easier than the logo change and has already been implemented in BlackBerry App World.  I couldn’t make the new logo look too much like a name tag, which is what the Meetup logo is based off of.  I couldn’t make the font in the logo look like any type of magic marker, like someone wrote a name on the name tag, another Meetup touch.  And finally, I couldn’t use the Meetup red or anything that looked too similar to the red in the logo.  The orange on my DeanLogic site was apparently too close to the red, so I had to change the orange to more of a brown.  There was a bit of an email chain trying to get the logo correct for Meetup standards, which had me discussing the issue with two different Meetup contacts over a few days.  During this exchange, I also hinted that they should go after the other guy’s app as well, since he didn’t even alter the Meetup logo for his app.  At least mine had my DeanLogic logo included to show that it wasn’t an official Meetup app.

The ending result, since I didn’t use an image as a background, but simply a colored path did make the app much smaller.  While it isn’t what I wanted as a Splash Screen and logo, I now have an app size reduced down to 1 MB (1,157KB), a significant improvement from 24MB.  And the app icon logo is probably a little better than my old app icon, just not the obvious Meetup logo.  I guess that after the user downloads my app, the icon will become common place for them to click as the Meetup logo.  I am leaving the inside of the app Meetup red, just to give the feel that the user is back on the Meetup site.

Meetup for BlackBerry 10 icon New Meetup Splash Screen

Now, I just need to finish adding the Group search and join feature so I can release the new app with the new images.

The DeanLogic Smart Watch

by DeanLogic Z30

Lately there has been an uptick in wearable devices. Most likely due to the introduction of the Pebble and the latest rumors and announcements of smart watches from Samsung, Apple and Google, among the big hitters. With everyone coming out with what they seem to think a smart watch should be, I figured I should share my thoughts, just in case someone decides to build one.

The first thing is to focus in just the watch. Another wearable device that has been popular is the smart band. Nike Fuel Band, Fitbit, Jawbone and others are battling it out in this area. I hope that they continue to do so, regardless of what happens in the watch arena. I think that wearable body measuring devices, whether it be a tag or a clothes, has its own place. Even if some do provide feedback to the user and crossover into the smart watch segment, there is enough differentiation to keep competition strong in each segment. I believe this so much, that I have been trying to get my hands on a developer Razer Nabu in order to make an app for BlackBerry 10, yet I still want the perfect smart watch beyond the biometric devices.

casio calculator watchSo, back to the watch. Since I was a kid, companies like Casio have attempted to make the watch smarter. While it was cool in the 1980’s to have a calculator or a game on your watch, you wouldn’t be taken seriously, unless you were a rocket scientist or something similar. The watches always looked silly. A trend in the past decade has been to make watches tell time in binary or some other fancy method that only the user could hope to understand. The commonality here is, let the watch be a watch first. Something as simple as an analog watch face has worked for over a century, because it is simple and it works. When smart watch companies forget this basic premise, then it becomes a novelty and not a trend.  Of course, part of the problem with most smart watch companies is that they are not watch companies.

The other path taken with watches was to keep the analog functionality and add to it with all sorts of sports tracking features. For me, this is the correct direction for a smart watch. It is a watch first, makes no bones about being a watch, but also proclaims that it is more than just a watch. Again, Casio put their best effort into the ring, but I always thought Timex did a better job with their IronMan watches. But neither company really provided a watch that could be multifunction and be taken to a “function”. You would wear your smart sports watch to the trail or to the game, but wear a much nicer watch for the a night out.  Not only were the watch faces crowded, but the plastic and rubber bands made it obvious what the true purpose of the watch. Again, simpler has a way of impressing more than complicated and nobody is going to think your sports watch is stylish.  This was the case until Citizen, TAG Heuer and Tissot started changing things.
Citizen Proximity Even though medium to high luxury watches have been around for a long time, it wasn’t until the 90’s that medium to high luxury sport watches started making inroads due to the popularity of some sport stars.  I probably don’t even have to name a particular sports star’s name, because you probably already associate TAG Heuer with him, which (until really bad press happens) is probably the best way to get something trending in the hands of others. Citizen was early in pioneering smart watches by making ordinary watches use kinetic energy and solar power to keep their watches ticking. The kinetic energy watch seemed a bit annoying and that’s from being worn by a friend of mine and not me. However, Citizen kept trying and even came out with a watch called the Proximity, which had Bluetooth connection to a smart phone in order to share notifications. Unfortunately, the Proximity suffered from connection issues and pretty much market obscurity. It was a good attempt, a better attempt than most of the current efforts. I hope that Citizen keeps innovating and tries to enter the smart watch segment again.

moto 360The only upcoming smart watch that I feel comes close to a half decent effort, while still being a screen watch, is the Moto 360. And the main reason that I like it above all the 90 degree angled offerings is that it is trying t0 be a watch first. A huge thick watch, but a watch. Even with it running Android Wear, it is a very tempting watch due to its round shape and their efforts to advertise it as a watch first, even though it is a screen. I just hope it doesn’t feed ad tracking relative information about me as I move around. But, that is not where I would start for a smart watch.

Martian Watches is a close second as a starting point, as they try to provide stylish watches and the connection to the phone. But, Martian has a way to go to catch up with Tissot’s quality and functionality. For one thing, it isn’t water proof and from one review of their watch, it didn’t seem very responsive. As an entry level DeanLogic Smart Watch, the Martian would be great, if they would only open their API. They are doing the main concept that I like, which is to have the phone figure out the app logic and just send the basic commands to the watch.  And even though some of their watches are rectangular, they are watches first and then smart watches. Martian has also hit a good note trying to create watches that are aimed towards women as well, which seems to be something missing from the screen watches.Martian Notifier

The DeanLogic Smart Watch still needs to be classy when worn. So, no plastic band and video screen will do. I applaud Pebble for coming out with metal version of their watch, it is an improvement. However, money not being an object, the Tissot Touch is where I would start with a smart watch. First, it is already a smart watch with a barometer, altimeter and a face that is touch sensitive  (hence the name) among some of the features offered. Tissot has even taken a page from Citizen’s book and made it solar chargeable. The watch already comes in a metal wrapping, built for activity (sailing and racing have their own versions) and the battery lasts for months, not hours. Tissot Touch Expert Also, it looks good enough to wear all day at any event and then change into a suit or tux and not have to worry about pulling out another watch.  Sometimes you have to pack a little lighter.

From there, it needs low power connection to a smart phone that controls all the functions.  Bluetooth has improved its low power connections and their are other options.  What the watch doesn’t need is a connection to the Internet, let your phone do that. Tissot’s hands move with each function, so if your smart phone detects a timezone change, it could change the time on the watch. While it doesn’t sound important, being able to move any of the mechanical feature of the watch from the app is important. Other needed features would be light and vibration notification, which could use the Touch’s already built-in features. A few LED rings around the face to change the color based on the notification level and a half arch for the LCD screen for text notifications and a separate screen for default and developer made icons, are the only obvious changes.

DeanLogic Smart WatchNo need to build an app to live on the watch. BlackBerry 10 has Cards for interaction from one app to another. The DeanLogic Smart Watch app would only be a headless app with a Card that can be accessed by any app that a developer wants to make connect to the watch. No need to download a SDK to get your app connected.  The watch should have NFC tag on the back for synching to the phone and the headless app. This would help with making a quick and secure connection between the phone and the watch.  Any apps loaded on the phone that use the watch Card would trigger a notification the first time it invoked the Card.  At that point, the user could see what features the app would access and decide to allow or not allow.  If your smart phone doesn’t have NFC, well, you might be wonder about how smart your phone really is.   The Card would have basic features of text, LED, vibrate and the advanced features like being able to set the face hands. The watch would send back information when requested as well, including screen touch to acknowledge notifications. Since the phone app does all the thinking, developers could have an app that tracks body monitors while you do repetitions and then send the count to the watch as a counter using the face hands.

The most important part of the control of the watch, it should be “open”.  When I read that Android Gear won’t be compatible with iPhone, Windows or BlackBerry, that just angers me.  There is no reason to limit an accessory to one phone OS.  If you make the watch well enough, you might have imitators, but you will always win over those who don’t want cheap knock-offs.  And if you open it up to any phone (or, what I would call the master controller) connection, then you don’t have to worry about one phone falling out of favor and then losing all of your possible customers.  If the connection from the phone to the watch is secure and simple, then the commands should be readily accessible without the need for SDKs.

It probably would have been better for one of the phone companies to purchase one of the watch companies.  This would have helped keep things in perspective.  For now it is up to the body sensor people to keep pushing out their gadgets so that people don’t feel that the smart watches are the be all in wearable smart devices.

Full disclosure: I typed up to 1000 words of this article on my Z30 before opening it up on my PC. I added the majority of links and photos but, at that point, I couldn’t resize the inserted photos properly and I needed a bigger screen to see the entire story. I did created the final image on my PC as there isn’t an app to do it on my Z30 and I doubt it would have been much fun trying.  I love my Z30, but sometimes you need a PC.