Showing posts with label how. Show all posts
Showing posts with label how. Show all posts

2015-01-17

Level Up - Android Dev: How to get started with AndroidAnnotations (easy) (and build Chuck Norris app)

AndroidAnnotations is an open source framework for Android. Basically, you provide Java annotations for things, and the framework will auto-generate the necessary boilerplate code so you don't have to write it yourself. Runs at compile-time! (Read: No reflection or startup time impact) And, there's a lot of code AndroidAnnotations saves you from writing manually.

For example, want to run something in a background thread? Annotate the method with `@Background`. Want to run something in the main/UI thread? (rub some bacon on it) Annotate the method with `@UiThread`.

In this article, I provide a quick walkthrough for creating a very simple Chuck Norris facts app. I'll assume that you already have basic Android knowledge (and using Android Studio + Gradle). Then, at the end, I'll explain in more details some issues/gotchas I ran into while using AndroidAnnotations for the first time, and mention other goodies.

Getting started..

2014-12-06

Level Up - Android Dev: The default emulator is horrendously slow, use Genymotion!

Many years back when I built and published my first Android apps, I only tested them on the default emulator provided by Google. And, even now, the default emulator is still too slow for my liking. It doesn't allow me to properly test apps. So, I purchased physical devices so that I would never have to touch the Android emulator again.

Genymotion provides a different take on the Android emulator. I've known about it for at least a year, but never got around to trying it because of my really bad experience with the default emulator. I've always heard that it was much faster than Google's implementation, but I didn't think an Android emulator could ever be fast enough for me compared to my physical devices.

I'm always learning something new, and today was finally time for me to learn more about Genymotion and test just how much better it is.

Results: Excellent! So much of a great experience that I had to write this blog post about it! I should have tried Genymotion when I first heard about it, and this is my message to all Android devs to also try it out now!

Sidenote: I was going to compare the default emulator with the Genymotion emulator side-by-side, but it was taking too long to load for me, whereas Genymotion startup was a breeze of fresh air. It runs without any lag. It runs faster than my old API 17 device.

Another great benefit is that Genymotion provides system images for many of the most popular devices, including Samsung Galaxy, Samsung Note, HTC One, Nexus, and more. And, they have a very convenient plugin for Android Studio to launch the emulator.

TLDR: It's fast. I have to make sure I stress that because I didn't believe how fast it would be. Genymotion's Android emulator is much faster and better experience than the default Android emulator.



Here, I even saved enough time to write a quick walkthrough for getting started. ;)


  1. Go to Genymotion.com, click "Get Genymotion".
  2. Download the free version, you'll have to sign up and confirm your email. (It's quick and it's worth it!)
  3. Install it along with VirtualBox. For Windows users, they can bundle the two together in the download. For other, you'll have to install VirtualBox separately.
  4. If you try to run it now, you might get an error that says "genymotion virtualization engine not found. Unable to load VirtualBox engine". So, just restart your computer and that fixed it for me. Some others had to enable the virtualization feature in the BIOS.
  5. Run! Fast!
  6. Now, you can click run in Android Studio and you will see an option to load the app in the Genymotion emulator that is running.

Bonus: How to Install the Genymotion Plugin for Android Studio (and, the first time you click on the installed plugin button, you'll have to add the path to where you installed it. Windows default is "C:\Program Files\Genymobile\Genymotion". Mac default is "/Applications/Genymotion.app")
~ Danial Goodwin ~



2014-12-05

Level Up - Android Studio: How to Boost Productivity By Auto-Generating Getters and Setters

A best practice in Java is to encapsulate field variables by making them private and creating a "getter" and "setter" for each of them, as needed. Doing this with many fields can be a lot of boilerplate code to write. But, thankfully, modern IDEs, like Android Studio provide ways to auto-generate code so that you don't have to manually write it.

For example, if you have a class like the following:

public class MyClass {
    private int mId;
    private String mName;
}

Instead of manually writing each accessor (getter) and mutator (setter), go to the menu and click Code->Generate.. (hotkey `alt+insert), then choose the "Getter and Setter" option.

Done. That was fast. And, it will be just as fast with 20+ fields also.

But, wait! By default, Android Studio will include that "m" prefix (stands for "member" variable) in each of the generated method names, so you'll have method names like "setmId" and "getmId". There is a quick permanent fix for this also!

Go to File->Settings->Code Style->Java->Code Generation, then type a single "m" into the "Field", "Name prefix" field. Hit apply, then you are gone. All future code generations will take those "m" prefixes for field into account. Here's a screenshot to what this sentence means visually.

So easy to save a lot of time with Android Studio

That's it for this post. There are lots of other useful code generators also. If you are doing mindless work, it's probably been automated (or should be). ;)

~ Danial Goodwin ~



2014-11-17

Level Up - Android: How to Root Nexus 4 on Android Lollipop 5.0 (Easy)

In my last post, I explained how to flash Android Lollipop 5.0 system image to Nexus 4. After I did that to my own device, the next thing I did was root it, using fewer steps than that other post. ;)

Rooted Nexus 4 on Android Lollipop 5.0

This will be a quick walk-through for the steps I took to root my Nexus 4. These directions are extended from the site with the great "CF-Auto-Root" tool that we will use.

Prerequisites:

  1. I assume that your bootloader is unlocked. If not, please see my previous post for how to unlock the bootloader.
  2. I assume you have `adb` added to your environment variable PATH. If not, please see my previous post.
  3. I assume you are running Windows, but Max and Linux users will be able to use these general directions also.


Walk-though for rooting the Nexus 4:


  1. Download the LGE Nexus 4 Android 5.0 file from http://autoroot.chainfire.eu/#fastboot
  2. Unzip the file. You should see two folders and three files in that folder, one should be called "root-windows.bat".
  3. Connect your Nexus 4 device to computer, then run `adb reboot-bootloader` in your computer's terminal. This will bring your device to the "fastboot" mode.
  4. Make sure again that your bootloader is unlocked before proceeding (label found at bottom-left).
  5. Open your computer's terminal to where you downloaded and unzipped the file, and run `root-windows` (Mac and Linux users use your own variant). You should see a red Android if the process is working.

Congrats! When the script is done, it will reboot your device and your Nexus 4 will be rooted!

This process will install the Root Check app so that you can verify a successful root.

More info:
  • I didn't have any trouble using these directions for rooting my Nexus 4, so if you have any troubles with the steps, then I'll try to help in my limited capacity.
  • Previously, when I was running Android 4.4 rooted, I used ES File Explorer to browse the root directories. But, it didn't work in Android 5.0, so instead I am now using the Root Browser app successfully.

~ Danial Goodwin ~



Level Up - Android: How to Flash (Upgrade) Nexus 4 to Android Lollipop 5.0 (Easy)

If you have a Nexus 4, then you can have Android Lollipop now! Google recently released the factory image, and I'm now successfully running it (with root, which will be explained in a later post).

Nexus 4 running Android Lollipop 5.0
This will be a short walk-through because I assume you already have the tools needed, but just need the steps to get the flash done. If you have any questions, then please write a comment and I will update as necessary.

  1. Download Android Lollipop 5.0 factory image: https://developers.google.com/android/nexus/images#occam
  2. Uncompress the file, possibly twice. I used 7-zip. You should see six files there, including a zip, which you do not have to unzip.
  3. Make sure `adb` is in your PATH environment variable, which can be found in %android-sdk%/platform-tools/. Also, you will need `fastboot.exe` from that same folder in your PATH. (I assume you already have the Android SDK and you know what I mean by "Advanced system settings"->Environment Variables->PATH.)
  4. Connect your Nexus 4 device to computer, then run `adb reboot-bootloader` in your computer's terminal. This will bring your device to the "fastboot" mode.
  5. At the very bottom-left, you should be able to see whether your bootloader is locked or unlocked. It must be unlocked to flash a new system image. If unlocked, you're good, go to the next step. If locked, then run `fastboot oem unlock`. WARNING: Unlocking will erase all data.
  6. Open your computer's terminal to where you downloaded and uncompressed the files, and run `flash-all`. That command will run the "flash-all.bat" script which will setup the new system image for you!

Congrats! When the script is done, it will reboot your device and Lollipop will be running. It may take a bit for it to boot the first time.

More info: There sure is a lot more information you could read about this entire process, but that's not what this post is for. These are the minimal instructions (with appropriate warning) for most people wanting to do this. If anybody has some good resources to share, then please add them to the comments.

Now, are you ready to root your Nexus 4?

:)
~ Danial Goodwin ~



2014-11-13

Level Up - Java: What is Vararg?

I like to remember vararg as "variable-length arguments". You may see them parameterized as "foo(Object... objects)" or "foo(int... ints)" or maybe "main(String... args)". The triple-dot signifies the vararg, and the method that has them uses it as an array.

Example code:

/** Returns input as a comma-separated list. If input if null
  * or empty, then this returns an empty string. */
public static String convertToString(Object... objects) {
    if (objects == null || objects.length == 0) { return ""; }
    StringBuilder sb = new StringBuilder();
    for (Object object : objects) {
        sb.append(object.toString()).append(", ");
    }
   return sb.substring(0, sb.length() - 2).

2014-08-30

Level Up - Android: Speed up your Gradle build times with one-line!

Whether or not you are using Android Studio, Gradle build times are slow (especially when you don't have continuous automated builds (another discussion)).

Here's one way to improve the speed Gradle commands like `assembleRelease` is to enable the Gradle daemon. I've sped up my release builds by about 20%!

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-08-13

Level Up - Android: How to get started with Android Wear and the Wearables Emulator

Recently, I started working on Android Wear for the first time. It's been fun playing around with the new platform and form factor. And, of course, the official Android docs that I read could be condensed further for absolute newcomers. So, in the typical fashion, I've created myself a cheat sheet that I would use next time I would want to learn the easiest way for how to best create Wearable apps.

I've open sourced all my code so far on GitHub. It includes how to first set up the virtual Wear device, connect to the handheld device, and how to have the app send and open a notification on the wearable.

https://github.com/danialgoodwin/android-wear

~ Danial Goodwin ~



2014-03-22

Level Up!: Do Users Need To Click "I Agree" to TOS Button To Give Consent?

(TLDR: No. Courts decide these cases simply by whether the person had reasonable notice of the Terms & Conditions. If you have a website/app and plan on collecting personal info or just have customers in general, the I highly suggest you read more about this topic. Disclaimer: IANYL.)


As a UX designer, I try to make things that are as simple and painless as possible for users to use. One pain (and protection) that almost every product/app needs is a Terms of Service (TOS) agreement, aka Terms of Use (TOU), aka Terms And Conditions (T&C), aka End User License Agreement (EULA).

The current "best practice" for showing TOS to users is by providing a clear link near the "continue to use app" button (which could be a register or purchase button). This is so that most users don't have to go through the extra step of clicking "I Agree" to something that they likely didn't read. Also, having the TOS pop-up interrupts users' flow (and can sometimes be quite scary-looking).

But, unfortunately, before today, I never really thought about the legal consequences of the different methods to show users the terms and conditions. I just used methods that I noticed many other great UX designers and companies using. So, I wasn't able to explain the legal-ness (to my satisfaction) to concerned client.

I took it upon myself to take the time to do some research around this area and organize it into this post, with sources and references cited.

In my research, I have found that the courts also know that most users don't read the TOS, and clicking "I agree" doesn't mean that the user has read it. What the courts look for is mainly that the user has had the easy opportunity to find and read the TOS, if they wanted to.

There are two main ways that users "agree" to TOS:

  • Click-wrap Agreement, aka "click-through agreement": This means that users must take some sort of action that signifies their consent to the TOS. This action could be a button that says "I Agree". Also, near the call to action, it is sufficient to say "By [continuing], you agree to our Terms of Service", with the TOS having a direct link.
  • Browse-wrap Agreement, aka "not a contract": Basically, saying users agree to TOS by browsing website/app, and the link to TOS is not extremely easy to find in regular use. A link at the bottom of the website could be considered hard to find, especially when there are many other links down there too.


My Summary (Just from my research (links below), though more can always be done.)

  • If your app collects or uses personal information, then use the click-through (clickwrap) agreement.
  • Remove any clauses about unilaterally editing contract at any time.
  • Add ability for company to modify terms, with prior notice. [More research needed for exact words to use]
  • Add ability for users to reject TOS, e.g. by terminating account. 



A few sources I read, in order of my recommended readings (Yes, there is a "Good" before "Great", just because of what this post was supposed to be about):
 - Great: How Zappos' User Agreement Failed In Court and Left Zappos Legally Naked (Forbes)
 - Great: The Clicks That Bind: Ways Users "Agree" to Online Terms of Service (EFF)
 - Good: Terms Of Use And Privacy Policy Best Practices (UpCounsel)
 - Great: Website Terms and Conditions: Some Best Practices (JDSupra)
 - Miscellaneous, but good: Terms of Service; Didn't Read (TOSDR)
 - Good: Browse wrap (Wikipedia)
 - Okay: Clickwrap / Browsewrap Agreements: It’s the Notice, Stupid!

Further Reading:
 - Terms of Use and the Digital Millennium Copyright Act (DCMA)
 - Search "Clickwrap vs browsewrap"


Disclaimer: I am not your lawyer (IANYL). This post's only intention is to help point readers in the right direction to learn more about this topic.

~ Danial Goodwin ~


ps - Bonus info! The terms "click-wrap" and "browse-wrap" come from physical goods/software that was "shrink-wrapped". Manufacturers had license agreements that basically said users agree to TOS by removing the shrink-wrap. (Source: Wikipedia)



2014-03-08

Level Up - Puzzles: Connect a 4x4 Grid of Dots With 6 Contiguous Lines (5x5 w/8, 6x6 w/10)

(TLDR: After solving a 3x3, try to solve a 4x4, 5x5, etc. I have proof that all of them have a solution.)

A common brain teaser is to connect a 3 by 3 grid of dots with four straight lines without picking up the pencil. See image below:

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 ~



2014-03-01

Level Up - Business: How To Change Your Filed Information With The State Government (Florida)

If the information you have filed with the state has changed, then you are supposed to let the state government know about it. This blog post will simply point you to the page where you can find all the information that you need to change your filed emails, addresses, FEI/FEIN/EIN, your business name, and more.

For the state of Florida, you will need to go to the Sunbiz site at http://www.sunbiz.org/address_change.html.

Now that I have this information written down in my blog, next time I need to make a business change I will remember to just look at this post to find the link easily, rather than searching through the different government business websites.

~ Danial Goodwin ~



2014-02-27

Level Up - Android Dev: How To Automatically Extract Hardcoded Strings To res/values/strings.xml

This is just one of the many refactoring features of Eclipse. Using this extract feature, you won't even need to open res/values/strings.xml to add the String resources nor manually write out reference to the resource.

This saves a lot of time, and allows the best practice of putting String constants away from the UI/Java files so that localization can be performed easier. This method I'm about to show you is especially productive because it can change all instances of that particular String to point to the xml string resource so that you don't have to do it individually one-by-one. (I'm doing maintenance on code that has everything hardcoded, so this is a lifesaver.)

To automatically extract the String, it's easy enough:

Step 1: Highlight the entire String that you would like extracted and sent to res/values*/strings.xml
Step 2: From the menu bar, select Refactor->Android->"Extract Android String..."
Step 3: Preview options and confirm changes.

Step 2: Automatically extracting string menu option.


Step 3: Many different great refactoring options to choose from.


This works in the XML and Java files for your Android application. And, this is much quicker than manually changing all instances of hardcoded Strings to getString() and @string/.


~ Danial Goodwin ~



2014-02-25

Level Up - Webmaster: How To Get Started With MediaWiki

Want to create your own wiki pages like Wikipedia? You can organize all your thoughts, add notes for your new book you want to write, and more. The wiki can be either public, private, or half and half. You decide.

Going through this process will allow you to edit any and all features that are provided with MediaWiki, the wiki engine for Wikipedia and many other wiki sites.


Step 1. Download MediaWiki, it might be as a .tar.gz file, which in that use 7-Zip to unzip the compressed file, you may have to use 7-Zip twice to fully open it and see the source files.

Step 2. Copy all the files to a directly on your domain.com/mediawiki/w/ directory. One of the easiest ways is using FileZilla, navigating to the public directory using the GUI, then click+drag all the files into the directory. Note: The reason I said that particular directory is because it will allow you to do a lot more later on, like setup the domain.com/wiki site to serve the pages in your wiki. As you wait for all your files to upload to your server,

Step 3. Create a new database and user for that database. This is the method that the MediaWiki instance will be using to save and retrieve all the information for your wiki.

Step 4. Wait until all the files have finished uploading to your domain.com/mediawiki/w/ directory, then navigate to that page in a browser. It'll say LocalSettings.php file not found, so this is where you will use a wizard to setup all the properties of your site, like public/private and more. Each of these properties can always be changed later. I recommend reading through all of them to understand better what is available to you.

Step 5. After going through the entire wiki, the wizard will prompt you to download the LocalSettings.php file which you can then add to the same folder that you previously installed all the files in.

Step 6. In a browser, navigate to your domain.com/mediawiki/w/ and see that you have your main default page show. Congrats, you now have an instance of MediaWiki running on your own server.


If you run into any problems during this process, you can click on the little question marks in the wizard to pop up more information of a section or input area. Another great source of information is on the official install page.


~ Danial Goodwin ~



2014-02-15

Level Up - Webmaster: How To Shorten Default MediaWiki URL to Short (Canonical) URL Form

This was my first time shortening the URL for MediaWiki to canonical form and it literally took me less than five minutes to fully complete and test. I bet you can do it in two minutes.



Quick and easy directions:
1. Go to MediaWiki ShortURL Builder (Your wiki will have to be temporarily public)
2. Type in your current URL, for me it was " http://danialgoodwin.com/mediawiki/w/"
3. When you click "Go", make sure the article path says "/wiki/$1" or wherever you would like your MediaWiki to appear to users.
4. You now have all the code at your fingertips to place on your server. I used a GUI FTP client (like FileZilla) to transfer the new data because that was the quickest for me.


The Code:
If your configuration is the exact same as mine, then you can use these following sections of code to enable the shortcodes.

At the root of your domain, in the .htaccess file (make it if you don't have it), include (I added the "REGION" comments just for readability and future maintenance):
# REGION Redirects for MediaWiki Short Canonical URLs
RewriteEngine OnRewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/mediawiki/w/index.php [L]RewriteRule ^/?$ %{DOCUMENT_ROOT}/mediawiki/w/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-fRewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-dRewriteRule ^/?mediawiki/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/mediawiki/w/thumb.php?f=$1&width=$2 [L,QSA,B]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-fRewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-dRewriteRule ^/?mediawiki/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/mediawiki/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
# ENDREGION Redirects for MediaWiki Short Canonical URLs

In your MediaWiki's LocalSettings.php file, insert the following lines (preferably right under "$wgScriptPath" and "$wgScriptExtension" just to keep things organized):
## Added for short URLs.$wgArticlePath = "/wiki/$1";$wgUsePathInfo = true;
## Added for short URLs because .htaccess on root includes 404 thumbnail handler config.$wgGenerateThumbnailOnParse = false;


Note: With this method, you don't even need a /wiki/ directory to make it appear that all the files are there. You should use this method so that when you make changes to the backend, the frontend will still be the same for users, search engines, and SEO. It also makes URLs easier to remember and more.

More detailed information: Manual:Short_URL

~ Danial Goodwin ~



2014-02-14

Level Up - Webmaster: Transfer MediaWiki Instance To Another Domain or Server

I just completed the process for the first time, so it is fresh on my mind. Provided here is an easy summary of the exact links and steps that I needed. I went from MediaWiki version 1.20 to 1.22.2.

MediaWiki recommends only transferring files/database between same versions. So, these steps will also quickly include updating the "old" wiki first before installing a new instance on the new domain.

This information is for small, non-customized wikis. For more important data, you should probably read Manual:Upgrading.

Upgrade to newest stable release (optional)
0. Check requirements by reading the release notes
1. Backup files and database. The different ways include SSH, FTP, and via phpMyAdmin. More info
2. Upgrade files. Latest version. One idea is to upload these new files in a different directory, then change the names of the two directories so that the new one starts serving the files.
2.1. Added back LocalSettings.php, Images folder, and custom extensions.
3. Upgrade database. For the web method, navigate to "/mw-config/index.php". Some requirement checks will be performed during the setup wizard process.
4. Test if successful.

Create MediaWiki instance in the new server/domain
0. Backup files and database if you haven't already done so in the first section.
1. Create new instance of MediaWiki on new domain.
2. Import old settings and files from old domain, and change link locations as appropriate.
3. Test.


More detailed info: Manual:Moving a wiki

~ Danial Goodwin ~



2014-02-09

Level Up - Webmaster: Setting Up Your First Laravel Website Or App

(For webmasters, a continuation on my last post Level Up - Webmaster: Installing Laravel and Composer on Bluehost.)

This walkthrough contains all the instructions I would have needed on one page, rather than looking through twenty different pages. This is a blunt how-to for connecting to a database with Laravel and displaying information. At the end are links for more specific and advanced info.

The following has explicit instructions and commands for a shared hosting provider like Bluehost, but the instructions should be the roughly the same for other providers and setups. I suggest to follow the steps explicitly the first time through, then run through it a second time with your specific project's names.

0. This simple "tutorial" assumes that you already know a little bit about Laravel and have possibly read my first install and setup walkthrough.

Setup the database:
1. Create a database on your server with a user and password.
2. From your root project folder, edit app/config/database.php to match your new database credentials.
3. In your root project directory, run php-cli artisan migrate:make create_users_table
4. You should now have the file that looks something like: app/database/migrations/2014_02_09_195357_create_users_table.php. Edit the up() and down() function to look like:
    public function up()
    {
        Schema::create('users', function($table)
        {
            $table->increments('id');
            $table->string('email')->unique();
            $table->string('name');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('users');
    }
5. Now, back in the project root dir, run: php-cli artisan migrate
6. At this time, your tables in the database will be automatically created. Add some data manually so that we can test that retrieving data works.

Create a view:
7. Create a route (subdirectory pointer) in app/routes.php by adding the following code:
    Route::get('users', function()
    {
        $users = User::all();

        return View::make('users')->with('users', $users);
    });
8. Create two new views in app/views. Call the first one layout.blade.php and add this code:
   
       
           

Laravel Quickstart



            @yield('content')
        
    
Create the second view, called users.blade.php:
    @extends('layout')

    @section('content')
        @foreach($users as $user)
            {{ $user->name }}
        @endforeach
    @stop
9. Go to your doman.com/users and you should have all the user names from the database displayed on the page.


Note:
- If the php-cli command doesn't work for you, then try just php


More info:

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
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-dist
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 ~