Skip to content

Instantly share code, notes, and snippets.

class Factory {
public Product createProduct(String name){
throws new FactoryMethodRuntimeException();
// 구현부분
}
}
class Factory {
public Product createProduct(String name){
throws new FactoryMethodRuntimeException();
// 구현부분
}
}
class Factory {
public Product createProduct(String name){
return new Product(name);
// 구현부분
}
}
class Factory {
public Product createProduct(String name){
return new Product(name);
// 구현부분
}
}
abstract class Factory {
public abstract Product createProduct(String name){
// 구현부분
}
}
<provider name=”com.example.autos.AutoInfoProvider”
authorities=”com.example.autos.autoinfoprovider”
. . . />
</provider>
content://com.example.codelab.transportationprovider/train
content://com.example.codelab.transportationprovider/air/domestic
content://com.example.codelab.transportationprovider/air/international
import android.provider.MediaStore.Images.Media;
import android.content.ContentValues;
import java.io.OutputStream;
// Save the name and description of an image in a ContentValues map.
ContentValues values = new ContentValues(3);
values.put(Media.DISPLAY_NAME, "road_trip_1");
values.put(Media.DESCRIPTION, "Day 1, trip to Los Angeles");
values.put(Media.MIME_TYPE, "image/jpeg");
Uri phoneUri = null;
Uri emailUri = null;
// Add a phone number for Abraham Lincoln. Begin with the URI for
// the new record just returned by insert(); it ends with the _ID
// of the new record, so we don't have to add the ID ourselves.
// Then append the designation for the phone table to this URI,
// and use the resulting URI to insert the phone number.
phoneUri = Uri.withAppendedPath(uri, People.Phones.CONTENT_DIRECTORY);
import android.provider.Contacts.People;
import android.content.ContentResolver;
import android.content.ContentValues;
ContentValues values = new ContentValues();
// Add Abraham Lincoln to contacts and make him a favorite.
values.put(People.NAME, "Abraham Lincoln");
// 1 = the new contact is added to favorites
// 0 = the new contact is not added to favorites