Saturday, May 28, 2016


Java files and their corresponding XML layout files:

  • MainActivity.java
    • nav_drawer_base.xml
      • This file contains the xml for Navigation drawer and menu layout. It also contains the FrameLayout used as the canvas for the app content.

  • BaseFragment.java
  • MainFragment.java
    • main_frag.xml
      • This layout file is wrapped in a CoordinatorLayout
      • Toolbar to replace the default ActionBar, 
      • TabLayout bar for tabbing, and a 
      • ViewPager element to support 

How to get the main_fragment layout swapped into the container view slot:
How to get the Navigation Drawer working:
DrawerLayout drawer = listener.getDrawer();ActionBarDrawerToggle toggle =
        new ActionBarDrawerToggle(ACA, drawer, toolbar, R.string.navigation_drawer_open,                R.string.navigation_drawer_close);
toggle.syncState();
drawer.setDrawerListener(toggle);
navigationView.setNavigationItemSelectedListener(this);
//swap home bar and give it a title
ACA.setSupportActionBar(toolbar);ACA.getSupportActionBar().setTitle("WASSUP");

Monday, May 16, 2016

User Dialog Fragment


Here are some important learnings for displaying a user dialog fragment. Steps to create:

  1. Create a new layout file for the dialog.
  2. Create a new Java class to inflate the fragment. This should extend the Android system DialogFragment class.
  3. Create reference in the main activity to inflate the dialog
To accomplish this, I simply created a new method in MainActivity.java called "showDialog()".

public void showDialog(View v){
        FragmentManager manager = getFragmentManager();
        FragmentDialog addDialog = new FragmentDialog();
        addDialog.show(manager, "addDialog");
}

You can see I am making use of two new objects:

  1. FragmentDialog --> This is the class I created to inflate the new xml layout
  2. FragmentManager --> Android system object used as an interface for dealing with fragments

Helpful resources:

Sunday, May 15, 2016

Android App 2 Goals

I finished my free GDG Android class this week and I'm starting up a little project to help teach me some Android programming building blocks. After being hand-held through development of a "Tic Tac Toe" game, I'm still a bit deficient when it comes to some important development principles. Here's my list of learning goals for this project - all of which I hope to make a separate post explaining how I've accomplished them:

  1. Loading ListView data with Adapters
  2. ListView item adds, selection, edit, delete
  3. Crawl Android contacts, birthdays, etc
  4. Fragments
  5. Context objects
  6. Context Menus

Thursday, February 5, 2015

CodeIgnite





Application Flow
CodeIgniter application flow

CodeIgniter User-guide: http://www.codeigniter.com/user_guide/toc.html
Routing: 
http://example.com/[controller-class]/[controller-method]/[arguments]
Index function: The "index" function is always loaded by default if the second segment of the URI is empty. Another way to show your "Hello World" message would be this:
example.com/index.php/blog/index/
By default the index.php file is included in the URL but it can be removed using a simple .htaccess file.

Wednesday, February 4, 2015

MVC concepts and frameworks

Over this past Christmas break, I had a lot of alone-time and could focus on starting a personal coding project. After brainstorming ideas, I decided to build a web app for my family/friends that would manage a College Bowl Season Pick 'Em tournament. It seems like the perfect challenge. I have some experience with PHP, so I settled on building a local LAMP server and set out to accomplish my goal... Only 12 more months until the 2015 Bowl Season.

I was happy with the amount of progress I was able to make during my time away from work for the holiday, but quickly let the project linger once January rolled around.

It gave me time to consider that, "Hey, wait a minute. There must be a more efficient way to build a web app. The amount of code repetition just doesn't feel right."
After some research, I discovered MVC. I'm still nowhere near being comfortable with the concepts, but I will be using this blog to help suss it all out. I will be exploring the following topics:


  • MVC
  • Frameworks - what's included and what it is.
  • Relationship between PHP Frameworks and MVC
  • Routing
  • CodeIgnite (CodeIgnite framework)

Blog Intro and Mission

My web programming experience is very minimal. I've worked on a couple month-long projects before in several settings: personal, school, and work.
  • Shared contact list / address book using WAMP on home intranet
  • hospital-style database app for school project (U of A)
  • Sports team site for school project (BU)
  • Tool maintenance for work projects
Aside from the initial project of setting up my first WAMP server and teaching myself the very basics of web programming, none of these projects have been particularly ambitious.

At this point in time, I expect to have adequate free time to hone some of my skills and want to make sure I do it right. I have several goals for my skills improvement, and several goals for this blog. This being the first entry in MillzCode (of hopefully many), I wanted to outline my goals mission:

Goals: 
  • Learn best-practices and improve elegance of code
  • Learn the principles of frameworks, and how to use them
  • Discover and share helpful resources (include links section whenever possible)
  • Utilize open source communities with the intention of sharing and borrowing code
  • Track current projects: Document any breakthroughs, and do my best to explain what I've learned.
  • Lean more towards "engineering" elegant code than "spewing" large volumes of code.
Mission:
  • Motivate learning, resource sharing, and community through frequent posts abiding by the principle that "you only know it if you can explain it".