I'm finally getting around to trying out a few different libraries that claim to make testing Android apps easier. First up is Robolectric.
For this quick walkthrough, I'm going to show how to start from scratch. You'll need no prior knowledge except for how to make a regular Android app.
In my GitHub repo: How to get started with Robolectric
~ Danial Goodwin ~
Showing posts with label guide. Show all posts
Showing posts with label guide. Show all posts
2015-03-02
2015-02-12
Level Up - Web Dev: How to get started with Polymer
Polymer:
The purpose of this article is to provide the basic information needed for the easiest way to get started with Polymer, including downloading creating a custom Polymer element, and reusing other elements. This article probably could have been split into three separate smaller ones, but I'm opting for a single page that can be used as a "cheat sheet". Most of this information is from the official site, but the difference is that this is shorter guide with many deletions, a few additions, and different organization.
1. There are a few different ways to get Polymer, but the easiest is with Bower, which is a package and dependency manager for many web libraries. So, install Bower if you don't already have it.
2. Create a new directory for your web project, then run `bower init` in it using a console. There will be a few questions, in which you can just press Enter if you don't know what to do yet. This initialization just produces a `bower.json` file, which has settings that can easily be changed later.
3. Install Polymer for the project by running `bower install --save Polymer/polymer`. This will create and fill a new directory `bower_components` with Polymer and its dependencies. Using `--save` will update the `bower.json` file by listing Polymer as a dependency. (Sidenote: To update the components in bower_components, just run `bower update`.)
Now, you can use Polymer in your project. See the section on [How To Create A Polyment Element] for a quick walkthrough on getting a simple app working.
1. Create a new file called `my-element.html` and add the following code. Make sure the import is pointing to the valid location within the bower_components directory that was created in the previous walkthrough.
2. Use your element in `index.html`. Here's a minimal example. Note: The above `my-elements.html` was put in an `elements` directory for some organization.
3. Run the app from a web server so that the [HTML Imports](https://www.polymer-project.org/platform/html-imports.html) work correctly. For example, to run on localhost instead of remote, if you have Python 2, then you can run `python -m SimpleHTTPServer`. If you have Python 3, then you can run `python -m http.server`.
Notes about Polymer elements:
1. Install the element for your web project, for example: `bower install --save Polymer/core-ajax`. The `--save` flag is used to add that element as a dependency to the `bower.json` file. After the optional `save`, the pattern is `/`. The element will be installed to the `bower_components` directory.
2. Use that element in your layout or custom element. An import statement must also be included, for example, to edit the custom `my-element` created in the last section:
3. Run the project and enjoy how easy it is to create modular web apps and site now. If you don't see anything on the page, then make sure that all your imports are pointing to the correct place.
The best way I've found to learn about using new elements is to see the demos and look at the source code for the ones that you like.
There's plenty more details that I haven't included in this article because they weren't vital to the setup process. So, if you have any questions, the official Polymer website is a great resource or I'll be happy to try to answer any questions.
:)
~ Danial Goodwin ~
- A wrapper with syntactic sugar for the new HTML WebComponents W3C spec.
- Allows easy modularization and reuse of HTML/CSS/JS code.
- Creates more readable source files.
- Being actively developed by Google.
The purpose of this article is to provide the basic information needed for the easiest way to get started with Polymer, including downloading creating a custom Polymer element, and reusing other elements. This article probably could have been split into three separate smaller ones, but I'm opting for a single page that can be used as a "cheat sheet". Most of this information is from the official site, but the difference is that this is shorter guide with many deletions, a few additions, and different organization.
Getting Started For The First Time
This is a quick walkthrough for how to get started with Polymer from scratch.1. There are a few different ways to get Polymer, but the easiest is with Bower, which is a package and dependency manager for many web libraries. So, install Bower if you don't already have it.
2. Create a new directory for your web project, then run `bower init` in it using a console. There will be a few questions, in which you can just press Enter if you don't know what to do yet. This initialization just produces a `bower.json` file, which has settings that can easily be changed later.
3. Install Polymer for the project by running `bower install --save Polymer/polymer`. This will create and fill a new directory `bower_components` with Polymer and its dependencies. Using `--save` will update the `bower.json` file by listing Polymer as a dependency. (Sidenote: To update the components in bower_components, just run `bower update`.)
Now, you can use Polymer in your project. See the section on [How To Create A Polyment Element] for a quick walkthrough on getting a simple app working.
How To Create A Polymer Element
In this quick walkthrough, you'll create and implement a simple Polymer element called `my-element`.1. Create a new file called `my-element.html` and add the following code. Make sure the import is pointing to the valid location within the bower_components directory that was created in the previous walkthrough.
2. Use your element in `index.html`. Here's a minimal example. Note: The above `my-elements.html` was put in an `elements` directory for some organization.
3. Run the app from a web server so that the [HTML Imports](https://www.polymer-project.org/platform/html-imports.html) work correctly. For example, to run on localhost instead of remote, if you have Python 2, then you can run `python -m SimpleHTTPServer`. If you have Python 3, then you can run `python -m http.server`.
Notes about Polymer elements:
- The name of the element must have at least one dash `-` in it. (Reason: It's part of the web component spec as to not interfere with official HTML tags.)
- The `noscript` attribute used in the above sample code indicates that it's a simple element with no script, which allows it to be registered automatically.
How To Reuse Other Polymer Elements
First, find some elements with Bower by running `bower search Polymer`. This will show most of the elements that the Polymer team as created. For a curated list of custom elements, check out customelements.io/. For a scrape of GitHub of all the projects that mention "web component", see Component Kitchen. These instructions work for both Polymer elements and regular web components as long as they are registered with Bower, otherwise they'll have to be installed manually.1. Install the element for your web project, for example: `bower install --save Polymer/core-ajax`. The `--save` flag is used to add that element as a dependency to the `bower.json` file. After the optional `save`, the pattern is `
2. Use that element in your layout or custom element. An import statement must also be included, for example, to edit the custom `my-element` created in the last section:
3. Run the project and enjoy how easy it is to create modular web apps and site now. If you don't see anything on the page, then make sure that all your imports are pointing to the correct place.
The best way I've found to learn about using new elements is to see the demos and look at the source code for the ones that you like.
There's plenty more details that I haven't included in this article because they weren't vital to the setup process. So, if you have any questions, the official Polymer website is a great resource or I'll be happy to try to answer any questions.
:)
~ Danial Goodwin ~
2014-08-26
Level Up - Paint.NET & Android: How to create new color palettes for Android Holo and Material design
If you work in Android and Paint.NET, here's some quick tips and resources to make both easier to work with. When designing graphics in Paint.NET, it would be really useful to have direct access to all of the Android design guide colors. So, here's how to save and load different color palettes in Paint.NET:
2014-08-18
Level Up - Android: How to get started with Unit Testing in Android Studio
Recently, I finally got around to implementing the native unit testing that is provided within Android Studio (not third-party programs like Robolectric). So, after reading a few different sources, the following is the bare minimum that I would have needed in order to add the basic testing features.
2014-03-03
Level Up - Business: How To File the Annual Report (Florida)
When you run a business in Florida, you must submit an Annual Report every year between January 1st and May 1st. It will cost $138.75 to file. And, if not filed in time, then there is a $400 penalty fee and possibility that the company is "administratively dissolved". But, the good news is that the report is easy to fill out and submit, and it's all done online.
When you complete the form online, you'll be able to edit your business address and member(s) address(es). Then you don't need to file a separate form for changing the addresses with the state (an extra $25).
First thing is, you don't need to spend any extra money for a third-party to complete this state requirement for you. They may charge upwards of $35 to complete the form that is easily completed within five minutes.
To complete your Annual Report:
1. You will need, your business's document number, Federal Employer Identification (FEI/FEIN) or Employer Identification Number (EIN), an email address to keep on file, and about five minutes.
2. Go to https://services.sunbiz.org/Filings/AnnualReport/FilingStart
3. Start the form by imputing your document number, then read the directions on the page. It is all straight-forward.
4. Pay the filing fee and submit. Now, you are done.
Disclaimer: This is not legal advice. This post is mainly a pointer to help others who also need to Annual Report for Florida. I'm sure other states in the US also have a page similar to the one linked here.
~ Danial Goodwin ~
When you complete the form online, you'll be able to edit your business address and member(s) address(es). Then you don't need to file a separate form for changing the addresses with the state (an extra $25).
First thing is, you don't need to spend any extra money for a third-party to complete this state requirement for you. They may charge upwards of $35 to complete the form that is easily completed within five minutes.
To complete your Annual Report:
1. You will need, your business's document number, Federal Employer Identification (FEI/FEIN) or Employer Identification Number (EIN), an email address to keep on file, and about five minutes.
2. Go to https://services.sunbiz.org/Filings/AnnualReport/FilingStart
3. Start the form by imputing your document number, then read the directions on the page. It is all straight-forward.
4. Pay the filing fee and submit. Now, you are done.
Disclaimer: This is not legal advice. This post is mainly a pointer to help others who also need to Annual Report for Florida. I'm sure other states in the US also have a page similar to the one linked here.
~ Danial Goodwin ~
2014-02-08
Level Up - Webmaster: Installing Laravel and Composer on Bluehost
These steps will get you though getting Laravel up and running on your Bluehost server, though these instructions should be a good enough how-to for other shared hosting providers as well.
This was my first time experiencing (and hearing of) Laravel and Composer and had to look at many websites to figure this information out. Below is a walkthrough of all the steps I would have needed in one location. For more advanced and specific informations, I provide links at the end. But, the steps shown should be enough to get going quickly from scratch.
1. SSH into your server at ~/bin/
2. Ensure that you have PHP 5.3.7+ on your server. Composer requires 5.3.2+ and Laravel requires PHP 5.3.7+. You can check with which php and which php-cli
3. Install Composer: Run the command curl -s http://getcomposer.org/installer | php
Note: Step 5 may take a minute or two, there are many dependencies that have to also be installed for Laravel.
Extra steps
6. Look at this file for project-specific adjustable values: app/config/app.php and bootstrap/paths.php
7. See my next post for more walkthrough
More info:
- Laravel installation instructions
- Laravel configuration instructions
- Then, the Quickstart
Error: "warning: composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI"
Fix: Use the command php-cli instead of php.
~ Danial Goodwin ~
This was my first time experiencing (and hearing of) Laravel and Composer and had to look at many websites to figure this information out. Below is a walkthrough of all the steps I would have needed in one location. For more advanced and specific informations, I provide links at the end. But, the steps shown should be enough to get going quickly from scratch.
1. SSH into your server at ~/bin/
2. Ensure that you have PHP 5.3.7+ on your server. Composer requires 5.3.2+ and Laravel requires PHP 5.3.7+. You can check with which php and which php-cli
3. Install Composer: Run the command curl -s http://getcomposer.org/installer | php
4. Test that the installation worked by running php-cli composer.phar
5. Install Laravel: Run the command php-cli composer.phar create-project laravel/laravel --prefer-distNote: Step 5 may take a minute or two, there are many dependencies that have to also be installed for Laravel.
Extra steps
6. Look at this file for project-specific adjustable values: app/config/app.php and bootstrap/paths.php
7. See my next post for more walkthrough
More info:
- Laravel installation instructions
- Laravel configuration instructions
- Then, the Quickstart
Error: "warning: composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI"
Fix: Use the command php-cli instead of php.
~ Danial Goodwin ~
2013-05-16
The Outer Limits (Television Show) New Jesus
There are many great episodes that come to mind specifically when I think about The Twilight Zone or The Other Limits. Each one of them expand your thinking to new dimensions or allows you to see something in a new light.
It took quite a searches to find one episode in particular regarding religion. I tried to search queries such as, "the twilight zone new jesus", "the outer limits (tv show) religion", and many more searches that progressively got longer until something like "(tv show OR movie OR video) guy preaches, bible in his hand gets shot, he dies and he replaces jesus". Those long queries didn't even help so I had to start looking through each of The Twilight Zone and The Outer Limit shows' summaries one by one until I found the show that I was looking for.
The main episode I was interested shows a sample of what blind religion is and could be: The Outer Limit's "Revival" episode.
Whilst looking for that episode I found another interesting one that I kept running into when looking for the above show. It's about finding the DNA of Jesus and using in vitro fertilization to bring about the second coming of Jesus: The Outer Limit's "The Shroud" episode.
I could explain the full videos in just a few paragraphs in order for the reader to save more time, but I wouldn't want to take away from how awesome the series of The Outer Limits and The Twilight Zone are. Even though I talk about and link to two of The Outer Limits shows, in my opinion The Twilight Zone is better overall. The later expands one thinking in even more directions.
~ Simply Advanced ~
It took quite a searches to find one episode in particular regarding religion. I tried to search queries such as, "the twilight zone new jesus", "the outer limits (tv show) religion", and many more searches that progressively got longer until something like "(tv show OR movie OR video) guy preaches, bible in his hand gets shot, he dies and he replaces jesus". Those long queries didn't even help so I had to start looking through each of The Twilight Zone and The Outer Limit shows' summaries one by one until I found the show that I was looking for.
The main episode I was interested shows a sample of what blind religion is and could be: The Outer Limit's "Revival" episode.
Whilst looking for that episode I found another interesting one that I kept running into when looking for the above show. It's about finding the DNA of Jesus and using in vitro fertilization to bring about the second coming of Jesus: The Outer Limit's "The Shroud" episode.
I could explain the full videos in just a few paragraphs in order for the reader to save more time, but I wouldn't want to take away from how awesome the series of The Outer Limits and The Twilight Zone are. Even though I talk about and link to two of The Outer Limits shows, in my opinion The Twilight Zone is better overall. The later expands one thinking in even more directions.
~ Simply Advanced ~
2012-07-24
Get Things Done - Priority List
Recently, a friend commended me for the ability to concentrate and stay productive throughout the day, day after day.
One thing about me is that I treat my [Internet] bookmarks and emails as a todo list. I also have a physical and virtual notepad on both my physical and virtual desktop where I keep track of things I want/need to do.
But, just having todo lists isn't enough for many people. So, for those who don't have the willpower to take a "just do it" attitude towards daily and/or important tasks, there is a solution.
Or
Get started now. You don't need to waste time reading more productivity guides and how-to's; Any thing besides what's on the priority list will just waste your valuable time.
~ Simply Advanced ~
One thing about me is that I treat my [Internet] bookmarks and emails as a todo list. I also have a physical and virtual notepad on both my physical and virtual desktop where I keep track of things I want/need to do.
But, just having todo lists isn't enough for many people. So, for those who don't have the willpower to take a "just do it" attitude towards daily and/or important tasks, there is a solution.
Or
- Think of your todo lists as priority lists instead. And, there can only be one #1 priority task to do at a time. Then, just do that task without thinking whether or not you should do that one or something else.
Get started now. You don't need to waste time reading more productivity guides and how-to's; Any thing besides what's on the priority list will just waste your valuable time.
~ Simply Advanced ~
Subscribe to:
Posts (Atom)