I am building a RN project with "create-react-native-app" and "Expo". So how it is possible to run on Android & Ios device? How i can generate APK file? I am using sublime text 3 for writing code.
If you don't mind opening your app through the Expo app on real devices, all you need is to publish it onto the Expo ecosystem. Read more about publishing.
If you do mind that extra step and want to go the normal way, you need to create a standalone app for distribution:
When you’re ready to distribute your app to end-users, you can create
a standalone app binary (an ipa or apk file) and put it in the iOS App
Store and the Google Play Store. See the full guide to building a
standalone app.
Source
Related
I was able to run the React project on the Android emulator that came with Visual Studio 2022. At this point, I decided to generate an apk file, but due to the lack of Android Studio, there is no way to fully generate the apk file. How to assemble the project in this case?
To publish, the application needs to generate a key, at the key generation stage everything goes well. But due to the lack of configuration files and gradle itself, it is not possible to sign the application.
After building the APK of my React native app, I realized that the APK could be opened just like an archive and that there was inside of it a file named index.android.bundle which is the JavaScript bundle of the React Native app!
I don't understand why this file has been included there since the Android app works with compiled .dex files.
My question
Is there a way to make sure this file (JS bundle) is not included in the final application (APK for android and IPA for iOS) when creating it using either React Native or Expo ?
there is no way of not including the JS bundle in a react native app.
React native relies on that index.android.bundle, on android for example, in order to load your code. Basically all the JS that you've developed is inside these files and that's the main concept of React native.
A react native project is a regular native project (iOS or Android), that has a special view inside, on Android it's called ReactRootView and on iOS RCTRootView , these views are responsible for loading your JS bundle, in your case index.android.bundle, and then they communicate across the JS bridge in order to instantiate views and components.
I'll link you some articles explaining in more details how react native works and what's the concept of a JS bridge
https://hackernoon.com/understanding-react-native-bridge-concept-e9526066ddb8
https://formidable.com/blog/2019/react-codegen-part-1/
I am setting up a new expo application and want a support in my application.
I want to know how to add the android sdk of agora.io into my expo project?
Unfortunately both the iOS and Android SDKs for agora.io require editing of native code. As Expo abstracts native code away from you meaning the only way to access native code is to either create your project using react-native init or by ejecting your Expo project.
Looking at the docs for iOS you can see that it requires you to add the SDK either by using cocoa pods or by inserting it directly into you Xcode project file. https://docs.agora.io/en/Voice/ios_audio?platform=iOS#add-the-agora-sdk-to-your-project
Similarly for Android you have to add the SDK inside the Android folder and make changes to the build.gradle files.
https://docs.agora.io/en/Voice/android_audio?platform=Android#add-the-agora-sdk-to-your-project
However you are in luck. There are a couple of wrappers around the SDKs that can be used with a full react-native project or an ejected Expo project.
https://github.com/AgoraIO/React-Native-SDK
https://github.com/syanbo/react-native-agora
The above answer is out of date now, Agora does offer expo support per the following documentation:
https://www.agora.io/en/blog/building-a-video-calling-app-using-the-agora-sdk-on-expo-react-native/
The above article mentions this, but it should be noted that you will not be able to use Expo Go to test video call functionality since it requires native modules for the microphone and camera. I can speak from first hand experience that I have been able to use Expo Go for other features in the app, just not the Agora portions.
I am planning to develop hybrid application for Android and iOS using Angular,Phonegap etc.
My main query is how to maintain single code base for iOS/Android?
Q1:I execute cordova create command to create project for Android. and write one Hello World App.Do I need to do create project again in iOS and copy www?
Q2: How about maintaining single code in git ? I am confused since folder structure are different for Android and iOS ?
Any help is appreciated.
I have searched many blogs but didn't find the this concepts.
Just develop your code under project/www
cordova platform add android
cordova platform add ios
Will create both platforms, and with cordova prepare, and cordova build, it will copy the files to each platform
To maintain code, just add your project into a GIT, and both platforms project/platforms/[IOS/android] will be in the same project. You can also gitignore the platforms if you want to maintain light your project
There is so much conflicting information out there on this, I'm hoping we can shed some light.
Goal: Create and develop a phonegap app that will be built using phonegap build.
1) I don't want to install the android and iOS SDKs, that's why I want to use phonegap build.
2) I created an app using the cordova cli cordova create hello
3) There is no phonegap.js or cordova.js I guess because I didn't add a platform. But I don't want to add a platform as that requires installing the SDKs
4) I need to be able to debug and test this, so I downloaded ripple, which may or may not work, I need the phonegap.js file first to see.
So has anyone figured this out? Building and developing and app that will be used on Phonegap build?
Thanks!
Phonegap will let you create a UI using webview of Android, iOS, Blackberry or other platforms. That means you need to have native SDK to apply Phonegap Build. It doesn't mean that Phonegap will create an App for you and deploy it to other platforms.