This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Factory { | |
public Product createProduct(String name){ | |
throws new FactoryMethodRuntimeException(); | |
// 구현부분 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Factory { | |
public Product createProduct(String name){ | |
throws new FactoryMethodRuntimeException(); | |
// 구현부분 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Factory { | |
public Product createProduct(String name){ | |
return new Product(name); | |
// 구현부분 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Factory { | |
public Product createProduct(String name){ | |
return new Product(name); | |
// 구현부분 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Factory { | |
public abstract Product createProduct(String name){ | |
// 구현부분 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<provider name=”com.example.autos.AutoInfoProvider” | |
authorities=”com.example.autos.autoinfoprovider” | |
. . . /> | |
</provider> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
content://com.example.codelab.transportationprovider/train | |
content://com.example.codelab.transportationprovider/air/domestic | |
content://com.example.codelab.transportationprovider/air/international |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder