Skip to content

Instantly share code, notes, and snippets.

View pakeeza29's full-sized avatar

Pakeeza pakeeza29

  • Islamabad, Pakistan
View GitHub Profile
@pakeeza29
pakeeza29 / StoreContract.java
Created January 27, 2018 10:36 — forked from udacityandroid/StoreContract.java
Example contract class for a table which contains data about the store's headphones stock
public final class StoreContract {
public static abstract class HeadphoneEntry implements BaseColumns {
public static final String TABLE_NAME = "headphones";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_PRICE = "price";
public static final String COLUMN_STYLE = "style";
public static final String COLUMN_IN_STOCK = "in_stock";
public static final String COLUMN_DESCRIPTION = "description";
@pakeeza29
pakeeza29 / WeatherContract.java
Created January 27, 2018 09:47 — forked from udacityandroid/WeatherContract.java
Contract class for a weather application called Sunshine
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@pakeeza29
pakeeza29 / Helper Method - releaseMediaPlayer()
Created December 28, 2017 04:06 — forked from udacityandroid/Helper Method - releaseMediaPlayer()
Miwok app: Cleaning up MediaPlayer resources
/**
* Clean up the media player by releasing its resources.
*/
private void releaseMediaPlayer() {
// If the media player is not null, then it may be currently playing a sound.
if (mMediaPlayer != null) {
// Regardless of the current state of the media player, release its resources
// because we no longer need it.
mMediaPlayer.release();