Sencha Touch 2 - Help to create .apk file on PC - javascript

I´m starting with sencha touch 2 tech,and now I´m stuck in creating the .apk file.
This is what I have done since the begining to where I´m stuck:
Download Sencha Touch SDK
Install Java JDK
Install NodeJS
Install Ruby
Install Sencha CMD
After that I created my app:
In the command line --> sencha generate app MY_APP_NAME MY_APP_FOLDER(I use the folder www of my wamp server)
Then with Eclipse for PHP Developers,I opened the folder and start editing the files to create my app.
Now I have finished my app and want to create the .apk file to test it in a real device(in my wamp server runs perfect).
And I´m stuck on how to create the apk file,I have read lots of tutorials but no one is clear.
Please some help on how to create the .apk file step by step or something helpfull.
Thanks.

Create Simple Android Project in Eclipse and put your www folder in assets folder.
And write below code in your MainActivity:
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
Now simply run your Application.

For creating apk files, you can create and setup Cordova environment as described here.
For some additional help, see this reference.
Once you want to make apk for your android device. Just go through the steps here. But i will advice you to use build of your app to work with in your cordova app.
After making build of your project, Check the following steps:
cordova create yourapp com.example.yourapp YourApp
cd yourapp
cordova platform add android
cordova build android
After this you should copy your project and paste it into the immediate www folder of your cordova project. And then run
cordova run android
Deploy the .apk file in your emulator or real device to test the app.
Let me know if it helps.

Finally I solve my problem. I found that through this link it autogenerates the files.
Before I discovered that you need to create via sencha cmd the production files through the command in the app folder:
sencha app build production
With this two steps I created the .apk file,donwloaded and tested it.
Thanks to the previous comments.

Related

How to generate apk of react native app without Android Studio

I have developed a react native app without installing Android Studio. Though I have installed some tools which were absolutely needed for the development.
My Android folder structure is something like this:
Android
.temp
build-tools
cmdline-tools
emulator
licences
patcher
platforms
platform-tools
tools
.knownPackages
Now that I have completed making my app with react native, I want to build an apk (valid and signed) of that and upload it to google drive as of now and share it with my friends, But the problem is, my potato cannot support Android Studio
I could have used expo, but everyone who wants to install my app will have to install expo client app first which is a problem
I hope my sisters and brothers will help me, I am completely new to android-development.
Thanks.
EDIT:-
I was using a real android device for development till now
This solution is for React-Native CLI , don't know it will work with EXPO.
first generate keystore file using in terminal go to java bin folder and then run this
keytool -genkeypair -v -keystore my-upload-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
after that paste that generated keystore file in your android app folder
after that you have to add configuration in your gradlw.properties file
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=*****
MYAPP_UPLOAD_KEY_PASSWORD=*****
and also change in app/build.gradle file :
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
...
then
$ cd android
$ ./gradlew bundleRelease
for better guidence visit :
https://reactnative.dev/docs/signed-apk-android
If you are using Expo managed flow then you dont need any IDE for build creation, not even macOS machine for ipa, just couple of commands and your build will be ready in 30 min depending upon queue on turtle server.
If you are working with bareflow or React CLI then. you will. be needing assistance of IDE for build creation of both platforms and mac machine for iOS.
For help on commands for build creation on expo managed flow, use this link
Creating android build from Android studio, you can take help from here
Regarding your concern related to build sharing, expo gives you a link from where people can download the APK or IPA. That would ease out the problem related to build sharing

Phonegap build final apk file locally without phonegap build website

I use Phonegap CLI to make my android apps every thing works fine, but when I want to make my final .apk I face a problem
I have SDK JDK Java and all environment variables
I generated my .keystore and when i run phonegap build --release i have no error my problem is this
there is no folder called bin or any .apk file in my folder
I red all documents and questions from stackoverflow and I still have this problem
what do you think? should i switch to cordova CLI ?
PhoneGap has been discontinued.
Switching to Cordova CLI is certainly an option, but many find that installing the build toolchain is a lot of trouble to get working (and keep working).
If you prefer the convenience of a build service like you had with PhoneGap, have a look at VoltBuilder, Ionic or Monaca.

Adding Cordova Platforms

Hey, Guys! I recently started to work with Cordova and when I run the Cordova platform add android i get the following error. I have successfully placed the environment variables for Java and for the Android SDK as well. But the npm modules does not exist in C:/Windows/System32/npm as shown in the error, It is in the Users/My username/AppData/Roaming/npm folder. Some guidance would be appreciated.
I followed the following scripts which are shown in the official Cordova documentation to create a new project.
Cordova create hello com.example.hello HelloWorld
cd hello
Cordova platform add android -> where I'm stuck at
Kindly Check the Android Version Provided by Cordova and verify with your current Android version installed on your system , if there a mismatch :
1) Update Android Version From Android Studio SDK Manager
2) Update Cordova Platform - Refer: Cordova Documentation
External Source
cordova - Error: Failed to fetch platform android
I figured out halfway what the the problem was. There was a file named 'npm' in my C:/Windows/System32 directory wich was of 0kb size, and once i deleted it, the error vanished. But not all the way though. I was able to install the browser platform but not the android platform via cordova platform add android or even specifying what the matching cordova-andriod pluggin to be with cordova platform add andriod#version.
Only through the cordova platform add https://github.com/apache/cordova-android.git script I could install the andriod platform and once it was done other steps worked fine, and the project ran through the Android AVD. Any idea why the normal command to add the android platform didnt work, Just want to know but if it happens again i think Im gonna have to run the get from git command again. Thanks

How do I add ‘google-services.json’ file to a Meteor/Cordova project?

I'm trying to add a 'google-services.json' file to the Cordova project root folder as required by the cordova-plugin-fcm plugin (this plugin allows a receiving push notifications from Google Firebase). But because I'm using Meteor, the project root folder is not the same as the cordova root folder.
I've tried adding the file to both:
/<meteor project root>/cordova-build-override/google-services.json
/<meteor project root>/cordova-build-override/platforms/android/google-services.json
However I still receive the following error:
While adding plugin cordova-plugin-fcm#2.1.1 to Cordova project:
Error: cordova-plugin-fcm: You have installed platform android but file
'google-services.json' was not found in your Cordova project root
folder.
Its initiated by this file: https://github.com/fechanique/cordova-plugin-fcm/blob/master/scripts/fcm_config_files_process.js#L842
Any idea what I'm doing wrong?
Thanks in advance
Apparently this is a bug with the 2.1.1 version of cordova-plugin-fcm https://github.com/fechanique/cordova-plugin-fcm/issues/212.
I installed a different firebase plugin, cordova-plugin-firebase with my google-services.json file located at:
/<meteor project root>/cordova-build-override/google-services.json
and everything is now working as expected.

d3.js run as app with cordova

Anyone know the commands to make my d3.js directory a cordova project and then run it on a device? When using Sencha cmd I ran sencha cordova init com.mycompany.MyApp MyApp to create the project, then sencha app run native to run the app on my device. But what's the commands for d3.js?
Thanks,
You might be getting the concept wrong. sencha provides you a command line tool, that wraps cordova/phonegap commands and provides additional goodies. d3.js is a library and does not come with a command line tool such as sencha. What you need to do is use cordova/phonegap commands inside your d3.js directory to create/build and run the project on your device.
phonegap create my-app initializes project
phonegap local run android adds, builds and runs project on your android device.
For more details check the docs.

Categories

Resources