How do I create apk file for a Xamarin.Android application - android

I am new to android development and need to create an apk file for an android application I made in Xamarin Studios so my peer can test it on his device. How can I create the apk file?

For even simpler/faster testing, you can:
connect an Android phone to the USB and use it for debugging/testing.
See https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development.
build your app (as debug, for example)
Every time you test on your phone by clicking on the "play button" button example, it automatically creates an APK under bin\Debug\ or bin\Release.
The file you are looking for is the "Signed apk", e.g. com.companyname.MyApp-Signed.apk
Copy this file to the device using any method (I usually use USB or GDrive). On the device, download it and click on it to install.
Important:
"Use Shared Runtime" inside the project properties/Android Options must be Disabled, otherwise Mono Runtime won't be included and your app will crash on phones where Mono isn't installed.Example

Select Build menu next click Archive for Publishing
Right-Click on build which do you want get apk file next select Sign and Distribute
Select Ad Hock and click next button
Select testing certificate and click next button
Publish and choose where do you want save apk file.

With the latest Visual Studio 2019 and the latest xamarin, I will literally walk you through all the steps:
Change your project from "Debug" mode to "Release" mode like below:
Build your android project first.
Right-click on your android project -> click "Archive..."
It'll show something like this: Let it complete its processing
When it's done, click the "Distribute" button, it'll open a menu like this:
Click on the "Ad Hoc" button and click the "+" button like below:
fill the form and click the "Create" button
Select your saved settings and click the "Save As" button
Chose your location to save and save the APK file and get it from where you saved it :)

For simple testing:
Build the project in Release mode
Go to your project's /bin/Release folder
Inside the folder, you will find the required signed apk file.
The apk file should now be installable simply by running it from an Android device.

Related

After sending APK to other device, application crash

I spend some time writting basic android apps, and I wanted to share it with my friends. I tried both APK Extractor and sending an APK file from project folder. In both cases after installation an app icon and title are visible, but app crashes in the second it is opened. I even tried to do it on my phone. It works perfectly when I'm openning it via Android Studio, but crashes after installation from APK. What can be the problem? Do I need to put some permission somewhere?
EDIT
I needed to build APK one more time. Now it's working, I'll leave it in case someone will have the same problem. Just go to Build>Build APK
Goto File -> Settings -> Build,Execution -> Instant Run and uncheck the "Enable Instant run ..." Option
uncheck option and click apply button

Mobilefirst application apk file not installing in real devices

i am using mobilefirst platform for hybrid application development.
I created an application in and created .apk file of this application:
Generated Android project folder -> Android tools -> Export unassigned application
I then copied this apk file to android device and try to install this .apk file. At this time its showing Application not installed.
It's properly working in simulator and browser.
What is the issue here?
The problem you are facing is due to the fact that you have exported an unsigned application, which is not intended for distribution purposes.
Try Exporting a signed application package, by following one of the following steps :
"Right click project -> Export -> Export Android Application"
"Right click project -> Android Tools -> Export Signed Application Package"
Both of the above methods will export a signed application file, used for distribution purposes.
You may also test your app on a real device by just connecting your device to the testing machine via a USB cable and then following step below :
Right Click on your Project root -> Go to Run As -> Select Android Application -> Now a popup is shown with all the active devices -> Select your device from the list
**
Newbie Guide to Export Signed Application and configuring keystore file in Eclipse :
"Right click project -> Android Tools -> Export Signed Application Package"
A popup as shown below would appear, if your project won't contains any erros :
Click Next
On clicking Next, you'll get a screen as shown below :
5.On this screen, make sure Create new keystore is checked.
6.Browse to the location, you want to create a new keystore at, and also add a password to access it later.
7.Then Click Next
8.On clicking next you'll get a screen as shown below :
9.Fill all the fields in this screen, (ONLY first five are mandatory), In validity fill the number of years this key would be valid for, then click Next.
10.On clicking Next you'll get a screen as shown below :
11.Browse to the location you want to keep for apk file in, and Click Finish, and you are done!
Hope this helps!
Did you try with a Signed application package rather than an Unsigned application package?
It could be that in your device settings (under Security) you have not allowed to install applications from Unknown Sources.
Enable support for Unknown Sources
Try again with an unsigned package
When you select Run As > Run on Android device", the application gets signed with the debug keystore supplied by Android, so it's still a "signed" package.

Android - Install signed apk via Eclipse

Good day.
I have an application and I recently wrote a code to make it update programatically by fetching the updated apk file on a server I host. I made the updated apk by changing the version code to version 2 and version name to 1.0.1 in the Android Manifest file. I also placed a textView in the first activity to know if it is the updated application or not. However, an issue I encountered while updating is that I get the An existing package by the same name with a conflicting signature is already installed error when Android tries to install the downloaded apk file. Since the error is about a conflicting signature, I guessed that whenever I install an application to my device (Nexus 7) from Eclipse, the application is not signed. What I did was that I Exported a signed copy of the version 1 of the application, moved it to my Nexus 7, and installed. From that signed application version, I tried to update and I encountered no problems.
However, this process is not efficient at all because if I want to debug my application to see if data stored like the database or sharedPreferences persist between app updates, what I'll have to do is to export my app, copy to tablet, then install. This does not allow me to use logCat efficiently - as the session filter won't work. The only way for me to see my logs is via the All Messages category and look for my tags.
So, my main question is: Is there a way to install a signed copy of your application via Eclipse so you can still debug efficiently via LogCat?
A secondary question: What happens to the private app data like the SQLite Database and the SharedPreferences when the application upgrades versions? Are they deleted?
When you debug (or run) Android will use the default store key for signing your application, and you can change it on Windows -> Preferences -> Android -> Build
Change your debug keystore there with custom debug keystore
Yes Its possible to install signed copy your application via Eclipse and you can still debug efficiently via LogCat.
Follow These steps.
1. Right click on your project from project list in eclipse.
2. Click Export.
3. Then select Export Android Application
4. Then select the project to export.
5. Click Next.
6. Then give the path of signing key (Keystore file). If you don't have any then create new keystore file by selecting Create new Keystore radio button on that Dialog.
7. Enter and confirm password and click Next.
8. Select Alias of Keystore file. which you have given while creating that file.
9. Enter password for that Alias and click Next.
10. Select the destination to export apk file and click finish.
It may take few minutes to build your app. Time depends on your application size.

How to create package installer link for Android application package?

i have created one Android Application.
I install it on mobile by connecting USB.
I want to install it without connecting mobile to PC.
How can I create package installer link to install pacakage?
There is a good walkthrough of sorts on developer.android.com
FOR DEPLOYING:
Here are a few steps to get you started:
Right click on your Project and locate "Android Tools" at the bottom.
Locate an option in the sub-menu Export Signed Application Package...
In a Window that pops up:
Select the project to export: Ensure you have the same project selected that you wish to create an APK of and hit the Next button
Keystore Selection: You have the option of either choosing an existing keystore or creating a new one. Follow the steps based on the option you select.
Key alias selection: While creating a new Keystore, you also create an alias. Based on your earlier selection (in STEP 2), you will have to choose an existing key or create a new one. Again, follow the steps in this section.
Finally, Destination and key/certificate checks: Hit the browse button and select the path on your computer where you want the APK to be created.
After following these steps, you will have an APK created which can deployed to the Google Play store or can be transferred to any _ compatible_ devices for installation.
Copy your Application apk(installer) from your project bin folder and store it in your phone memory or sdcard.
After copy in phone memory or sdcard. use file browser to find apk and install it via android default installer.
Thanks

How to convert from my android project to .apk file?

I am beginner in android. I am successfully created one application. In that application name is Hello. It's successfully running in My Emulator. My questions are How to convert that application to .apk files. Because how to i run this application(Hello) to my android tablet. If it is possible please send information for how to convert taht application to .apk format. Otherwise if it is not possible send Reason. Please reply your answers and comments are valuable me. Thanks.
Simply try below existing answers -
Export Android .apk
.Apk file From application
exporting-a-signed-android-package
Steps to Export an .apk
Right click your project -> Select Android tools -> Export Signed application package -> Next
Choose create new keystore -> set the new location using browse -> and give new name for key also
give the password & confirm the password also -> Next
Give alias name -> give new or old password & confirm the password also -> fill validity -> and below make one column to fill -> Next
set the .apk file's destination to existing location or new location -> Finish
Actually if you don't want to publish your app for now,and just want to get it working on your phone, then you just have to copy the yourApp.apk file from /workspace/yourProject/bin directory to your sdcard and then install it.
from eclipse
refer link
http://www.jetbrains.com/idea/webhelp/exporting-a-signed-android-package.html
http://developer.android.com/guide/publishing/app-signing.html
On the main menu, choose Tools | Android | Export Signed Android Package. The Export Signed Android Package Wizard starts.
from command line :
http://asantoso.wordpress.com/2009/09/15/how-to-build-android-application-package-apk-from-the-command-line-using-the-sdk-tools-continuously-integrated-using-cruisecontrol/
even it is also important to know about signing
http://developer.android.com/guide/publishing/app-signing.html
Rightclick your project in Eclipse -> Export -> Android -> Export Android Application -> Next -> Create new keystore -> Enter infos -> Follow remaining steps
Eclipse does that for you (if you are only looking ot test it on your device rather than actually create an .apk, which is what it sounds like you really want to do).
Simply plug in your device to your computer after you have installed the proper drivers for it and it should show up as a target if you go to Run -> Run Configurations, select your app and then click on the "Target" tab. Select the device and then you are set to run it on your device from Eclipse.

Categories

Resources