Export Android java application files to device .apk - java

I have just started using Android Studio to learn app development.
I am attempting to run an existing complete android project on github on my android device. The project contains a 'res' and 'src' folder which contains multiple .java files for the application.
Other files include github relevant files like the .project, .gitignore, readme etc
How can I convert these files into a .apk file that can be run on my device?

1) Connect your device to laptop/desktop using usb cable
2) Enable virtual debugging in your device in developer tools.
3) Configure your device in AVD[i.e mobile] in android studio.
4) Once you connect your device and build and click on run in android studio it will create directly apk in your mobile only.
Refer
:https://developer.android.com/training/basics/firstapp/running-app.html
This link will help to configure virtual device.

Go to your Android Studio and at the top toolbar you will see tab "Build". Then select "Build apk"
Build->Build apk

Related

Can't install Dropbox plugin for Android Studio

I'm trying to add the latest (v5.1.1) Dropbox plugin to my Android Studio install (Bumblebee 2021.1.1) on Win10. I downloaded the .jar file from releases/v5.1.1 folder to an empty folder, then tried to install it using this method: from the Studio main menu I chose Plugins, selected the gear icon followed by Install Plugin From Disk, browsed to the .jar file location, selected it then pressed OK. I got an error message: "Fail to load plugin from file dropbox-sdk-java-5.1.1.jar". I tried installing the -5.1.1-javadoc.jar file using the same method, with the same result. I don't need the sources, I just want to use the SDK. Any ideas? TIA!
First, I think you meant "Android Studio" instead of "Visual Studio"?
If so, it sounds like you're attempting to install the Dropbox Java SDK as a plugin to Android Studio itself. The Dropbox Java SDK is not an Android Studio plugin though. It is a package for connecting to the Dropbox API from your Java app.
To install the Dropbox package in your app, you should use Maven or Gradle, as instructed here.
The Dropbox Java SDK also comes with an example Android app that uses the Dropbox package.
Thanks, Greg; your answer pointed me in the right direction. I had already added an 'implementation' directive to my Gradle file as per the directions on GitHub. However, I took the instruction to add the directive by editing my "project's build.gradle" too literally; I added it to the Project build.gradle file instead of adding it to the Module build.gradle. Problem solved!

I Build apk of my android project. Apk also build successfully. but when i try to install apk in my phone its not installing and showing error.?

This file does not have an app associated with it for performing this action. please install an app or, if one is already installed, create an association in the default apps setting page android studio build Apk this file does not have an app associated with it for performing this action. please install an app or, if one is already installed, create an association in the default apps setting page.
Make sure that your instant run is enable or not? If so then i had similar experience and i solved by disable instant run as follows.
If you are sure that the apk is build, check whether the file is having the apk extension (appname .apk ).
Better way is to let Android Studio install it for you instead of building apk and manually installing it:
Enable 'USB debugging' from you phones 'Developers Options' .
Connect your Phone to your PC and Click on 'Run' app option in Android Studio.
Select your device from the popup window.
If there is any already installed app, or any internal errors, Android Studio will take care of it.

Android App is not running on other devices

I just made a simple android app with 2 buttons. Each button onClick opens a new activity. I installed the app on my device via USB cable from Android studio and it runs fine on my device.
But here rises the problem, when I installed the app on my friends device after sharing via SHAREit the app installed on his device but did not run.
What could be the reason for this? And how can I solve this?
Please help. Thank you
This issue is most probably due to the Android instant run features. Try the following steps to get this working,
Step 1: From Android Studio, click on Build => Build APK. Once the build is complete, you will see an option to view the APK in explorer. Copy the app-debug.apk to a folder of your choice.
Step 2: Open a command line. Switch to the folder which contains app-debug.apk. Run the following command to install your APK on phone,
adb install -r app-debug.apk
Step 3: From your phone, use Share-it to copy the APK to your friend's phone. Now the app should run.
This is happening sometime, when do some changes in app configuration/ gradle by unknowingly,
DO THIS THING FOR SOULUTION:
Close Project in Android Studio.
Close Android Studio completely.
Rename your Project name.
Open Studio and import Project
Clean and Try to Run

My app is not running on another device

I recently made a simple android app .Its working fine in my device but not running on any other phone when i share it via SHAREit or other means. I have already disabled Instant Run and I am currently working on API 22(Lollipop) and have tried it the phones with higher API's such as API 23 (Marshmallow). Can anybody please fix it. Thanks in advance.
Debug apk that is installed to the phone by Android studio will always gets some error when shared using SHAREit and similar softwares.
Bulid -> Rebuild Project
Bulid -> Build apk or Generate signed apk
Try sending the newly generated apk.
Go to build options in toolbar and click on build APK. After that use that APK it works in all devices.

unable to install or locate android sdk in android studio

Here is my problem i have reinstall the android studio and i am unable to locate or install android sdk, whenever i open the android studio the give the error Android SDK path is not specified, i have saved it on my other drive for memory management reason, but when i give it that path it doesn't work.
I have also attached the image.
Thanks In advance.
try to Run android studio "run as administrator" and locate and apply your installed sdk.
If what you did does not work after reboot,
Download again but this time download it to your wanted location.
Add the location on your computer to Android Studio.
To download:
open a workspace in Android Studio
find a button with an arrow pointing down
it should say "Open SDK manager".
Press it and download the packages you need.

Categories