投稿時間:2023-08-04 17:20:34 RSSフィード2023-08-04 17:00 分まとめ(24件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT ITmedia 総合記事一覧 [ITmedia PC USER] サンワ、ハードタイプの抗菌マウスパッド https://www.itmedia.co.jp/pcuser/articles/2308/04/news160.html itmediapcuser 2023-08-04 16:17:00
IT ITmedia 総合記事一覧 [ITmedia ビジネスオンライン] 京大現役進学率ランク 1位の高校は? https://www.itmedia.co.jp/business/articles/2308/04/news159.html itmedia 2023-08-04 16:07:00
js JavaScriptタグが付けられた新着投稿 - Qiita JavaScript Primer を読んだ感想 https://qiita.com/kazu1212-star/items/17b5e02add0fb565ca57 javascript 2023-08-04 16:54:57
Linux Ubuntuタグが付けられた新着投稿 - Qiita Linuxmintのアップデートマネージャーで、nvidia-firmwareをアップデートしたら画面が吹っ飛んだので修復した話 https://qiita.com/yebi10/items/0a692103c7db8ce2ebb3 firmware 2023-08-04 16:38:28
海外TECH DEV Community A beginner's guide to OAuth 2.0 with Google sign-in: Enhance Android app authentication https://dev.to/hackmamba/a-beginners-guide-to-oauth-20-with-google-sign-in-enhance-android-app-authentication-2mhi A beginner x s guide to OAuth with Google sign in Enhance Android app authenticationAndroid mobile operating system is the most popular operating system in the world with approximately Billion users and a market share of It has even seen further adoption due to the recent introduction of Jetpack Compose an Android modern toolkit for building native UI with less code and powerful Kotlin API Developers can now build native and cross platform applications for phones TVs computers etc Beyond building these applications developers must also ensure that they are secure and that only authorized users can access protected resources In this post we will follow a step by step guide on enhancing an Android app authentication using Google as the provider The project repository can be found here PrerequisitesTo fully grasp the concepts presented in this tutorial the following are required Basic understanding of Kotlin and Android IntelliJ IDEA or Android Studio properly set up Appwrite account sign up is completely free Google account Getting startedTo get started we need to clone the project by navigating to the desired directory and running the command below git clone The project s com example android auth directory consists of the following packages navigation consists of files used in setting up the application navigation screens consist of the application UI screens Running the projectWe can run the project by selecting the preferred emulator and clicking the Run button The step above will run the application on the selected device Set up a project on AppwriteTo get started we need to log into our Appwrite console click the Create project button input android auth as the name and Create Add platform supportTo add support for our Android app navigate to the Home menu and click the Android App button Next we must modify the application by inputting android auth as the Name and com example android auth as the Package Name Enable Google as the preferred OAuth providerTo do this we must navigate to the Auth menu click the Settings tab and enable Auth as a provider We will fill in the required details later However we must copy and keep the redirect URI it will come in handy when setting up our application on the Android developer portal Set up Google OAuth With our project partly configured on Appwrite we must also set up our project on the Google console Create an OAuth consent screenThe OAuth consent screen helps us configure the application scope policy and other relevant details required for OAuth implementation It also shows our users a summary of the project and the kind of permissions our application requires To do this we need to log into the Google console and create a project Navigate to the OAuth consent screen under APIs amp Services select External and Create Input Quickstart as the App name fill in other required details and Save and Continue PS We must name our application Quickstart to avoid the “An error occurred while saving your app error Click on the Add or Remove Scopes add email and profile as shown below and Update Next we need to add test users Only the users we registered here will be able to test our application To do this click the Add User button input the test user s emails Gmail only and select Add Then click the Save and Continue button and review the configuration Create CredentialCredentials on Google console help applications securely access Google s enabled services We must create a credential for our application to use the OAuth functionality To do this navigate to the Credentials tab click the Create Credentials button and select the OAuth client ID Select Web application as the Application type input android auth as the Name input the Redirect URI we copied from Appwrite earlier as the Authorised redirect URIs and Create On creation we should see our application Client ID and Client Secret We need to copy and keep these credentials as they will be useful when finishing up our application set up on Appwrite Putting it together on AppwriteWith our application configured on Google we must create a link to it on Appwrite To do this we must update the Google provider details with the copied Client ID Client secret and Update Integrating Google OAuth with Android using AppwriteWith all that done let s build OAuth into our application First we need to install the required dependency To do this we need to navigate to the build gradle file inside the app dependency and add the snippet below under the dependencies section dependencies remaining dependencies here constraints implementation org jetbrains kotlin kotlin stdlib jdk because kotlin stdlib jdk is now a part of kotlin stdlib implementation org jetbrains kotlin kotlin stdlib jdk because kotlin stdlib jdk is now a part of kotlin stdlib implementation io appwrite sdk for android The snippet above adds a dependency constraint to the Kotlin version and Appwrite SDK as a required dependency We must also re sync the dependencies to ensure our Android build has no problems Configure OAuth callbackIn order for our application to redirect to the configured screen after authenticating through OAuth we must capture the Appwrite OAuth callback URL To do this we need to update the app main AndroidManifest xml file and add the snippet below under the lt application gt section lt activity android name io appwrite views CallbackActivity android exported true gt lt intent filter android label android web auth gt lt action android name android intent action VIEW gt lt category android name android intent category DEFAULT gt lt category android name android intent category BROWSABLE gt lt data android scheme appwrite callback PROJECT ID gt lt intent filter gt lt activity gt We must also replace the PROJECT ID string with our Appwrite Project ID Create servicesNext we need to create service files to separate our application logic from the UI To do this we need to create a utils package inside the com example android auth directory and inside this package create a Resource kt file and add the snippet below package com example android auth utilsdata class ResourceResponse var name String null var email String null var error Boolean null The snippet above creates a data class to represent the response we get from Appwrite when authenticating using OAuth Lastly we need to create a Kotlin Class Client kt inside the same utils package and add the snippet below package com example android auth utilsimport android content Contextimport com example android auth MainActivityimport io appwrite Clientimport io appwrite exceptions AppwriteExceptionimport io appwrite services Accountimport java lang Exceptionprivate class ClientInit context Context var clientInstance Client context setEndpoint setProject REPLACE WITH PROJECT ID class Client suspend fun loginWithGoogle activity MainActivity context Context ResourceResponse var account Account ClientInit context clientInstance try account createOAuthSession activity activity provider google var data account get return ResourceResponse name data name email data email error false catch e AppwriteException return ResourceResponse error true suspend fun logOut context Context var account Account ClientInit context clientInstance try account deleteSessions catch e AppwriteException throw Exception error login out The snippet above does the following Imports the required dependencies Creates a private class ClientInit to initialize Appwrite instance Creates a Client class with a loginWithGoogle and logOut method that uses the Appwrite instance to login with Google using google as the provider and log out by deleting active sessions respectivelyUsing the servicesWith that done we can start using the created services to build our application To do this first we need to modify the Navigation kt file as shown below depencies goes here Composablefun Navigation activity MainActivity val navController rememberNavController NavHost navController navController startDestination Screen Login route composable route Screen Login route Login navController activity composable route Screen Home route name email it gt Home navController it arguments getString name it arguments getString email The snippet above modifies the route to accept name and email as part of the arguments and adds them as an argument to the Home screen We will get an error after passing the arguments but we will fix this shortly Secondly we need to modify the Login kt file inside the screens folder as shown below package com example android auth screensimport android widget Toastimport androidx compose foundation Imageimport androidx compose foundation layout import androidx compose material import androidx compose runtime Composableimport androidx compose runtime rememberCoroutineScopeimport androidx compose ui Alignmentimport androidx compose ui Modifierimport androidx compose ui graphics Colorimport androidx compose ui platform LocalContextimport androidx compose ui res painterResourceimport androidx compose ui text font FontWeightimport androidx compose ui unit dpimport androidx compose ui unit spimport androidx navigation NavControllerimport com example android auth MainActivityimport com example android auth Rimport com example android auth navigation Screenimport com example android auth utils Clientimport kotlinx coroutines launch Composablefun Login navController NavController activity MainActivity var client Client val context LocalContext current val coroutineScope rememberCoroutineScope Column verticalArrangement Arrangement Center horizontalAlignment Alignment CenterHorizontally modifier Modifier padding dp fillMaxWidth fillMaxHeight Column horizontalAlignment Alignment CenterHorizontally Image painterResource id R drawable lock contentDescription lock image Spacer modifier Modifier padding dp Button onClick coroutineScope launch var data client loginWithGoogle activity context if data error true Toast makeText activity Error login in with google Toast LENGTH SHORT show else navController navigate Screen Home route data name data email colors ButtonDefaults buttonColors Color xFFE modifier Modifier height dp fillMaxWidth Text text Login with Google color Color White fontSize sp fontWeight FontWeight Bold The snippet above does the following Updates the required dependencies Creates client context and coroutineScope properties to initialize Appwrite instance get application context and perform an asynchronous operation respectively Modifies the button s onClick property to use the loginWithGoogle method handles the error appropriately and navigates to the Home screen by passing the returned data as route argumentsLastly we need to modify the Home kt file as shown below package com example android auth screensimport androidx compose foundation layout import androidx compose material Buttonimport androidx compose material ButtonDefaultsimport androidx compose material Textimport androidx compose runtime import androidx compose ui Alignmentimport androidx compose ui Modifierimport androidx compose ui graphics Colorimport androidx compose ui platform LocalContextimport androidx compose ui text font FontWeightimport androidx compose ui unit dpimport androidx compose ui unit spimport androidx navigation NavControllerimport com example android auth navigation Screenimport com example android auth utils Clientimport kotlinx coroutines launch Composablefun Home navController NavController name String email String var client Client val context LocalContext current val coroutineScope rememberCoroutineScope Column verticalArrangement Arrangement Center horizontalAlignment Alignment CenterHorizontally modifier Modifier padding dp fillMaxWidth fillMaxHeight Text text Welcome name color Color xFFE fontSize sp fontWeight FontWeight Bold Spacer modifier Modifier padding dp Text text email Spacer modifier Modifier padding dp Button onClick coroutineScope launch client logOut context navController navigate Screen Login route popUpTo Screen Login route colors ButtonDefaults buttonColors Color Black modifier Modifier height dp Text text Log out color Color White fontSize sp fontWeight FontWeight Bold The snippet above does the following Updates the required dependencies Modifies the function definition to accept name and email as parameters Creates client context and coroutineScope properties to initialize Appwrite instance get application context and perform an asynchronous operation respectively Updates the UI placeholder name and email with the parameters Modifies the button s onClick property to use the logOut method to log users out of the application and redirect them to the Login screenWith that done we can test our application by clicking the Run button We can also confirm logged in users on our Appwrite console Missing redirect URL errorWhen testing our application we might notice an error screen complaining about a missing URL It s an open issue that should be resolved soon ConclusionThis post detailed a step by step guide to implementing Google OAuth login in an Android application using Appwrite Beyond what was discussed above Appwrite s Android SDK also has robust functionalities that developers can leverage to build even more robust authorization and authentication mechanisms These resources may also be helpful Appwrite OAuth support Appwrite s Android SDK Appwrite official documentation Google Cloud console 2023-08-04 07:57:50
海外TECH Engadget Fisker unveils the Alaska electric pickup and sub-$30,000 Pear EV https://www.engadget.com/fisker-unveils-the-alaska-electric-pickup-and-sub-30000-pear-ev-071051468.html?src=rss Fisker unveils the Alaska electric pickup and sub Pear EVAt its Product Vision event in California Fisker unveiled no less than three EVs and also announced pricing and more details of the previously teased Ronin The new models include the Alaska electric pickup Pear EV priced at before incentives and the Force E a rugged off road version of the Ocean nbsp First on the docket however is the Ronin ーa four door supercar EV that the company teased last month Fisker previously showed only a brief glimpse of it promising a mile range and sub price tag Now the company has unveiled it in full on the outside only no interior shots but CEO Henrik Fisker is still being guarded about the technology ーand the price has roared way past its previous estimate Mike Blake reutersFisker said it ll hit MPH in under seconds thanks to three electric motors delivering horsepower via an all wheel drive setup As for the battery back quot we are looking to integrate the cells into the structure of the body and that will give us our goal of getting to miles of range quot Fisker said in a not exactly definitive statement The company is giving itself some time to get there though citing a delivery window near the end of nbsp The price though is a shocker Fisker didn t mention it at the event but a new reservation page says the Ronin will start at quot before any incentives quot or nearly double what the company originally mentioned Luckily interested parties will only need to put down a deposit which is just percent of the purchase price nbsp Mike Blake reutersThe most interesting vehicle is the Alaska electric pickup It s based on the Ocean and built on the same platform but has a pickup truck bed and midgate that lowers to extend the bed into the cabin ーallowing it to haul longer cargo than the shortish bed would suggest That s much like Chevy s new Silverado EV which it strikingly resembles nbsp The Alaska will start at it will be US built and qualify for EV incentives with a range of around miles between charges less than the Ocean However the company is promising a more expensive model that can go up to miles between charges Because it s based around the Ocean which is now in production the company expects it to go on sale as early as December ーsooner than the Pear or Ronin Henrik Fisker is much better at designing vehicles than estimating prices and production schedules though so take all those numbers and dates with a large grain of salt nbsp Mike Blake reutersThe Pear electric crossover will be Fisker s budget offering coming in at under with all wheel drive dual motors and range of about miles While just a bit smaller than the Ocean it will be built on a new platform that allows a percent reduction in parts and thus a lower price It will come in five or six seat layouts the latter via a front bench seat and offers what looks like an attractive but basic interior for the price Other touches include a quot Houdini Trunk quot lift gate designed to simplify cargo loading along with a frunk or quot froot quot in Fisker s nomenclature It also offers LED lighting and a quot lounge mode quot that lets you move the seats around to maximize comfort Fisker plans to build the Pear at Foxconn s Lordstown plant so it s eligible for tax incentives with production estimated around mid Again treat those price and production estimates skeptically nbsp Mike Blake reutersFinally Fisker unveiled the Force E an offroad adventure version of the Ocean It comes with inch off road tires and inch aluminum wheels along with a large roof rack and wide fenders It offers more ground clearance front rear and underbody skid plates and improved offroad handling The package is available to new buyers but existing Ocean owners can also upgrade their vehicles It s set to arrive in Q with pricing to be announced around then nbsp This article originally appeared on Engadget at 2023-08-04 07:10:51
医療系 医療介護 CBnews コロナワクチン接種の死亡事例含む52件を認定-厚労省が健康被害審査第3部会の審議結果公表 https://www.cbnews.jp/news/entry/20230804165439 予防接種 2023-08-04 16:54:00
医療系 医療介護 CBnews 窓口負担割合、申立書で不明なら前年実績などで判断を-マイナ保険証で厚労省が疑義解釈 https://www.cbnews.jp/news/entry/20230804162806 厚生労働省 2023-08-04 16:40:00
金融 JPX マーケットニュース [東証]監理銘柄(確認中)の指定:焼津水産化学工業(株) https://www.jpx.co.jp/news/1023/20230804-11.html 焼津水産化学工業 2023-08-04 17:00:00
金融 ニッセイ基礎研究所 日本の稼ぎ方-自動車業界の構造変化 https://www.nli-research.co.jp/topics_detail1/id=75721?site=nli 自動車産業で起きている構造変化はEV化だけではない。 2023-08-04 16:20:04
ニュース BBC News - Home NHS to expand use of private sector to tackle waits https://www.bbc.co.uk/news/health-66319064?at_medium=RSS&at_campaign=KARANGA labour 2023-08-04 07:02:48
ニュース BBC News - Home Afghan refugees moved out of hotels now homeless https://www.bbc.co.uk/news/uk-politics-66396052?at_medium=RSS&at_campaign=KARANGA accommodation 2023-08-04 07:27:29
ニュース BBC News - Home Canada's Alberta drops bid for 2030 Commonwealth Games https://www.bbc.co.uk/news/world-us-canada-66402140?at_medium=RSS&at_campaign=KARANGA victoria 2023-08-04 07:38:52
ニュース BBC News - Home What has gone wrong at Wilko? https://www.bbc.co.uk/news/business-66394238?at_medium=RSS&at_campaign=KARANGA recent 2023-08-04 07:52:36
ニュース BBC News - Home Ulez scrappage scheme extended to all Londoners https://www.bbc.co.uk/news/uk-england-london-66398942?at_medium=RSS&at_campaign=KARANGA uxbridge 2023-08-04 07:52:39
ニュース BBC News - Home Give cash to households in path of new pylons, government urged https://www.bbc.co.uk/news/uk-politics-66397256?at_medium=RSS&at_campaign=KARANGA infrastructure 2023-08-04 07:17:35
ニュース Newsweek 「裸にバッグとブーツだけ」の衝撃...米歌手の過激衣装にネット騒然 https://www.newsweekjapan.jp/stories/culture/2023/08/post-102352.php 2023-08-04 16:40:00
マーケティング MarkeZine 【参加無料】サツドラに学ぶ、リテールDX戦略 「商圏人口減少」に負けない事業への変革 http://markezine.jp/article/detail/43020 人口減少 2023-08-04 16:15:00
IT 週刊アスキー Switch版『圧倒的遊戯 ムゲンソウルズ』のプロモーションムービー公開! https://weekly.ascii.jp/elem/000/004/148/4148539/ nintendo 2023-08-04 16:45:00
IT 週刊アスキー 『超探偵事件簿レインコード』第2章まで配信可能に!出荷数は30万本を突破 https://weekly.ascii.jp/elem/000/004/148/4148537/ nintendo 2023-08-04 16:35:00
IT 週刊アスキー 「ポケふた」4基増設! 横浜ポケモンスポット観光マップも配布開始 https://weekly.ascii.jp/elem/000/004/148/4148514/ 観光振興 2023-08-04 16:15:00
IT 週刊アスキー 2台のデバイスを切り替えて1台の画面に表示するUSB TypeCドッキングススイッチ「US3311」 https://weekly.ascii.jp/elem/000/004/148/4148519/ displayport 2023-08-04 16:30:00
マーケティング AdverTimes サントリー、「アイスの実×ビアボール」が飲める期間限定BARオープン https://www.advertimes.com/20230804/article429703/ 期間限定 2023-08-04 07:47:29
マーケティング AdverTimes パルコ2023秋冬広告公開 ムービー主体の表現に転換、通年で物語が完結 https://www.advertimes.com/20230804/article429779/ newdeparture 2023-08-04 07:24:43

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)