Langsung ke konten utama

Postingan

Menampilkan postingan dengan label android

Download file using Okio in Android

Okio is a library that complements java.io and java.nio to make it much easier to access, store, and process your data. Simply Okio is a modern I/O API for Java.  In this post, we will see how to download image or any file using Okio. Okio is component for OkHttp Coding Part Create a new project in Android Studio. Add following dependencies to your  app-level  build.gradle  file. compile 'com.squareup.okhttp3:okhttp:3.6.0' Don't forget to add the following permission in your AndroidManifest.xml <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> Implementation Paste the following code in your Activity and Here, I have kept as MainActivity.java public void downloadImg(View view) { try { Request request = new Request.Builder() .url(imageLink) .build(); new OkHttpClient().newCall(request).enqueue(new Callback() { @Override public void onFail...

Youtube Video link to mp3 file - Library

Library to Download youtube video as mp3 files Created By How to Download Gradle: compile 'com.ajts.androidmads.youtubemp3:youtubemp3:1.0.0' Maven: <dependency> <groupId>com.ajts.androidmads.youtubemp3</groupId> <artifactId>youtubemp3</artifactId> <version>1.0.0</version> <type>pom</type> </dependency> How to use this Library: This Library is used to download mp3 file from youtube video link. new YTubeMp3Service.Builder(MainActivity.this) .setDownloadUrl("https://youtu.be/nZDGC-tXCo0") .setFolderPath(new File(Environment.getExternalStorageDirectory(), "/YTMp3/Downloads").getPath()) .setOnDownloadListener(new YTubeMp3Service.Builder.DownloadListener() { @Override public void onSuccess(String savedPath) { Log.v("exce", savedPath); progressDialog.dismiss(); } @Override public void onDownloadStarted() { ...

Hands on Xamarin Platform Pipeline - Develop - Add Facebook authentication

In this article I'll show you how to add Facebook authentication to the "RememberIt" mobile application. If not yet done, please read the previous post in the Hands on Xamarin Platform Pipeline series. Facebook app creation In order to be able to add Facebook authentication, we need to create a Facebook App. To do this, navigate to: https://developers.facebook.com/apps , click on "Add a New App" button then fill in the application information. Go to Settings then copy the App ID. Then always in Settings, click on Add Platform then Select Android. Fill in the following information: - Google Play Package Name: the package name defined in Android Manifest file. - Class Name: MainActivity in our case. - Key Hashes: where we can add Debug and Release Android key hashes. To generate the Debug Key hash, open the terminal then run the command below: Use 'android' as password then copy-paste the generated hash key. Now, click on Add Product under Products catego...

Hands on Xamarin Platform Pipeline - Develop - Add authentication using Azure Active Directory

After creating an offline application following the previous post . Now, we will start convert our offline application to a connected one using Microsoft Azure tools. In this post we'll add authentication using Azure Active Directory. Application Creation on Azure Active Directory To do this, login to https://manage.windowsazure.com and in case you don't have Azure Subscription a trial can be requested. Then, click on Active Directory as shown in the image below. Select an Active Directory, navigate to Applications tab, click ‘Add‘ button then select ‘Add an application my organization is developing‘. Choose an application name and make sure to select ‘Native Client Application‘ as type of application. On the final screen, provide the ‘Redirect URI‘ then validate the application creation. Once the app is created, navigate to ‘Configure‘ tab then write down the ‘Client ID’ that we’ll use later. User Creation on Active Directory In Active Directory main screen, navigate to Users...

Hands on Xamarin Platform Pipeline - Develop - Let's start by an offline application

After configuring the development environment following the previous post . Now, we'll be able to start developing mobile applications using Xamarin Platform. In this post we'll start by creating the offline version of our "Remember It" application. Application Creation Open Xamarin Studio IDE, please note that I'm using dark theme because I'm fan of it and the default theme that comes after fresh Xamarin installation is the light theme. Click on "New Solution..." button then select Android App. Fill in the application Name, Organization Identifier. For the Target Platform I chose 'Maximum Compatibility' to cover multiple Android versions (since 2.3), and finally I chose AppCompat Light theme to bring Material Design to my Android application.  In the final step, we can set the project name, the solution name and the project location. I checked the Xamarin Test Cloud option in order to create UI Test project that we'll use after. If you...