Label with dynamically created build number react native - reactjs

I'm building an app in React Native. I want to include a field in the settings screen which displays the build version of the app. This is because I test the app on several devices (5 different ones at the moment). A build label would therefore be useful just to be sure what bundle I'm running. The build label will basically just state the date that the bundle was built. For instance 20181201 (which would be 1st of December 2018). I can quite easily just create a constant, and update the constant manually before building a bundle. However, this relies on me remembering to update that label. It would be nice if this label was automatically generated at the time of build. Any good suggestions as to how I could achieve this in React Native?

If you write the build number you want in:
Android - app/build.gradle versionCode property
iOS - ios/[APP_NAME]/info.plist CFBundleVersion property
You can use react-native-device-info.
Check out getBuildNumber method.

I use a json file that contains information about the build. This json file is then imported and its contents are used to make a footer on the settings page, this allows me to track which build is on which device.
Personally I use Bitrise to make my builds, so in my workflow there I have a step that runs a bash script that updates the json file with specific information. i.e. date and time of build, Bitrise build number etc.
Alternatively if you don't use a CI suite like Bitrise
For iOS you could use a Pre-action in Xcode and run a script that would update the json file when you create your archive. Edit schema... select Pre-actions and then add a Run Script.
For Android you could use a custom task as explained in this SO answer Execute a custom independent gradle task in android studio

Related

Has the latest Codenameone build version lost functionality to scroll through container of rows containing

We have 4 containers in an array, we show the first perfectly, but when we set as current the next container to show it, we call forceRevalidate() on it but only the most general container is showed.
When i update the project libraries through Codename One Settings -> Basic -> Update Project Libs and clean&build project the error persist.
#Versions.properties
It hasn't changed locally for a while since we didn't push an update for Ant in ages. I suggest migrating to maven where you can check such functionality.
Notice that if this applies only to device builds those do get updated for Ant and will be consistent with the latest maven version.

"jar_project" Builder in Eclipse CN1 project loops on refresh

CN1 projects have an additional Builder "jar_project" configured.
Apparently this builder is looping when "Refresh using native hooks or polling" is checked in Eclipse Preferences -> General -> Workspace. "Refresh using native hooks or polling" is a nice feature to refresh the workspace files for changes made outside the IDE.
When editing the builder configuration via right click on a project -> properties -> builders -> jar_project and chiising edit I see that in the refresh tab the option "The project containing the selected resource" is selected. That is probably incorrect.
Anyway what is the builders "jar_project" purpose? Does it really need to be called after change of any project file?
The project is built using the build.xml file. It verifies that compilation works.
We don't support that eclipse mode and don't test against it. If you want to make changes manually they might work but we can't warrant them.

Why does ExtJS make so many GET requests

All I have is one graph / chart, and some tooltips by ExtJS on my website. Why does it have to make between 400 and 600 requests to my server just to load that? It's making calls to a zillion different .js files...
clickrepeater.js
manager.js
seperator.js
offset.js
button.js
textmetrics.js
item.js
box.js
auto.js
And that's just to name a FEW. On a slow connection, these requests take as long as 30 seconds to complete! And yet, I only have just the one production ext.js referenced by my html code. It's ext.js that's making all these additional requests.
Because you're running it in development mode where it loads each source file individually for ease of debugging (and some other things). You need to make a production build using Sencha Cmd which will concat all the required parts of the framework + your app into a single file.

IBM Worklight - App only starts once; gives error after saying Failed to load webpage

I created an iphone app in IBM Worklight using Angularjs, generated by yeoman. Everything works fine in the simulator, but when I deploy to my physical device, the app will open only once. Using the iphone configuration utility, the error reported merely says Failed to load webpage at that url.
I do not understand why it would only work one time.
It don't think this has got anything to do with angularjs and/or yeoman.
It sounds like you've changed the HTML filename in the common folder and the mainFile value in application-descriptor.xml. Changing the mainFile value used to cause a bug after launching the app a second time - it wouldn't find the resource, the HTML file.
If you indeed did the above, try the following:
Rename the application folder name to match the renaming you've done above
update the ID attribute of the application element in application-descriptor.xml to match as well
Make sure to delete the native folder
Re-build and deploy the app
This should now make the app launch a second, third, ... time as well.
Fixed in the upcoming Worklight 6.1.0.

Deploying AngularJS Seed application in WebStorm

I recently started to learn about AngularJS and came across WebStorm and the AngularJS plugin by John Lindquist. Started by creating a new project using the angular-seed project and imported to WebStorm using File -> Open Directory. My directory structure looks like this
Now when I try to Debug it I get a 404 error. If I move the file app/index.html to the root folder and adjust all URL's to begin with app then it works fine. Is there a way to keep the default folder structure without moving the index.html to the root folder and also make it work with WebStorm?
I am using WebStorm 6.0.2.
I use WebStorm 7, so there might be some discrepancy in comparison with version 6 that you're using, but the over-all functionality is the same.
Quick solution:
Open the file in the editor and right click in the code to access the context menu. Choose the "Debug" option, which should start a debug session pointing to the current page.
Configuration solution:
WebStorm supports configurations for setting up different debugging scenarios. From the "Run" menu, choose the "Configurations" option. Add a JavaScript debug configuration, and add the URL you want in the designated field within the dialog presented.
Then, when you initialize a debugging session (a general one, not one for a specific page), you're presented a small dialog that allows you to choose a debug configuration.
Maybe there are more options or ways to accomplish the same thing as well, but I've never really given it more thought. I hope this is a working solution for you, but if not there's alway the documentation. If you need further clarification with regard to my answer, just give me a comment.

Resources