カメラアプリを呼んでビデオを撮る
- AndroidManifest.xml
<manifest ... >
<uses-feature android:name="android.hardware.camera"
android:required="true" />
...
</manifest>
カメラアプリを呼んでビデオを撮る
<manifest ... >
<uses-feature android:name="android.hardware.camera"
android:required="true" />
...
</manifest>
func print(_ items: Any..., separator: String = " ", terminator: String = "\n") { | |
#if DEBUG | |
let formatter = DateFormatter() | |
formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" | |
// 文頭に日時を付与する | |
Swift.print(formatter.string(from: Date()), terminator: " ") | |
Swift.print(items, separator: separator, terminator: terminator) | |
#else | |
// なにもしない | |
#endif |
/** | |
* Program that implements classes for different kinds of dwellings. | |
* Shows how to: | |
* Create class hierarchy, variables and functions with inheritance, | |
* abstract class, overriding, and private vs. public variables. | |
*/ | |
import kotlin.math.PI | |
import kotlin.math.sqrt | |
fun main() { |
Android Studio 4.0.1にて | |
classpath 'com.android.tools.build:gradle:3.5.3' → | |
classpath 'com.android.tools.build:gradle:4.0.1' | |
にupdateした。 | |
Build APKすると | |
> Task :app:multiDexListDevelopDebug FAILED | |
AGPBI: {"kind":"error","text":"Type androidx.transition.R is defined multiple times: /Users/nijimac088/goo-memo-android/app/build/intermediates/transforms/RealmTransformer/develop/debug/1.jar:androidx/transition/R.class, /Users/nijimac088/goo-memo-android/app/build/intermediates/transforms/RealmTransformer/develop/debug/0/androidx/transition/R.class","sources":[{"file":"/Users/nijimac088/goo-memo-android/app/build/intermediates/transforms/RealmTransformer/develop/debug/1.jar"}],"tool":"D8"} | |
RealmTransformerとあるからRealm周りを疑ったが、結果違った。 |
/* | |
Android Basics: Add a button to an app | |
1.Classes and object instances in Kotlin | |
*/ | |
fun main() { | |
val myFirstDice = Dice(6) | |
println("Your ${myFirstDice.numSides} sided dice rolled ${myFirstDice.roll()}!") | |
val mySecondDice = Dice(20) | |
println("Your ${mySecondDice.numSides} sided dice rolled ${mySecondDice.roll()}!") |
// Android Basics: Introduction to Kotlin | |
fun main() { | |
val age = 24 | |
val layers = 5 | |
printCakeCandles(age) | |
printCakeTop(age) | |
printCakeBottom(age, layers) | |
} |
extension UIViewController {
// 簡易なアラートダイアログを表示する
func showSimpleAlert(title: String?, message: String?, action: ((UIAlertAction) -> Void)? = nil) {
let alertController = UIAlertController(title: title,
message: message,
preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK",
style: .default,
handler: action)
class LineView: UIView {
override func draw(_ rect: CGRect) {
layer.cornerRadius = 5
layer.masksToBounds = true
// 左側だけ丸くする
layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner]
super.draw(rect)
#Device(UDID)追加時 | |
developer portalで | |
1.Devices追加 | |
2.Profiles編集 | |
3.Profiles ダウンロード | |
4.BitriseのCode Signningに新しいProfilesをアップロード | |
5.XcodeのProject設定確認 | |
・Manual signningにしてcommit |
class PaddingLabel: UILabel {
// paddingの値
let padding = UIEdgeInsets(top: 4, left: 16, bottom: 4, right: 16)
override func drawText(in rect: CGRect) {
let newRect = rect.inset(by: padding)