MobileFirst 7.1 BusyIndicator showing weird characters - ionic-framework

I'm developing an hybrid app on MobileFirst 7.1, with Ionic libraries.
In a .js file I globally define
var busyIndicator = new WL.BusyIndicator ("content", {text: "DUMMY TEXT"});
but when I call for it to show, i.e.
busyIndicator.show();
I always get the same message, ignoring the text I put in the text field:
Image link here
I'm testing this on Android devices (Huawei P7 Ascend, Samsung Galaxy J5, both with Android 5.1). On the Android Mobile Simulator the message displays just fine.
p.s. "content" matches my html id, I tried putting null instead of "content" but to no avail.

A workaround
define in some common .js file
function showMyIndicator() {
busyIndicator.__options.text="Custom loading text";
busyIndicator.show();
}
and call showMyIndicator() each time you would call busyIndicator.show().
busyIndicator.hide() can be called normally (although you might want to define some 'hideMyIndicator()' function for homogeneity).
What is happening?
It appears that, as soon as I load (jQuery $.load() ) some new content in order to change page, the text fileld of the busyIndicator object defaults to "[(')ههههههه Loading]", which is defined in every native project inside messages.json.
That file is full of those weird signs, no idea about why.
Update
There's something corrupted in my project which causes those .json files to be generated with wrong characters, a freshly generated project didn't show the same issues so creating a new one and move the resources in there might do the trick.

Related

Unity WebGL Mobile browser workaround and keyboard input fix?

Hey everyone so I read that unity doesn't really support mobile browsers for WebGL games. im using 2020.1.4.And sure enough, the game gets a bit distorted by not being scaled properly. it's like the camera is bigger so it shows on the screen that blue color. I tried some things, setting width and height to auto or removing config.devicePixelRatio = 1; as suggested by a friend but nope! still looks horrible! And if that wasn't enough the keyboard doesn't show up when clicking on form fields. i tried this one
https://github.com/eforerog/keyboardMobileWebGLUnity
which displayed an error when pressed on and this one
https://github.com/dantasulisses/WebMobileInputFix which just didn't even compile!
Any ideas, please?
I did my research and tried every plugin I could find. I used Unity 2020.3.28f1 and tested both on Android-phone and iPhone.Here is my report.
These plugins don't work:
https://unitylist.com/p/f58/Unity-webgl-inputfield
https://github.com/eforerog/keyboardMobileWebGLUnity
https://github.com/dantasulisses/WebMobileInputFix
This plugin works, but you should use different settings for IOS and Android on same input field game object. If you use "prompt", it works for IOS only, and "overlay" works for Android only. Look for documentation in page:
https://github.com/unity3d-jp/WebGLNativeInputField
And this plugin works best at the moment. Yes, it is a bit ugly though, but it works.
https://github.com/kou-yeung/WebGLInput
And there is a fix for Unity 2021 for it:
https://github.com/kou-yeung/WebGLInput/releases/tag/1.0
There's a keyboard that overlays, when using it you just need to tap the notification to access it and then click the "back" button to hide it https://play.google.com/store/apps/details?id=com.fishstix.gameboard
I made this project that simply recreates a keyboard using buttons in unity.
I implemented it in a WebGL build successfully.
https://github.com/thetimeste/WebGL-Build-Keyboard-Unity.git
I would recommend using the native js window.prompt() fields as of writing. They have great cross-platform support, allow for extra features like special characters, emojis, copy and paste etc. and are pretty easy to set up. Once (or honestly if ever) Unity adds their own reliable implementation you can easily remove this lightweight implementation.
Create a .jslib file that has a function opening a window.prompt(description, currentText)
Return the result at the end of that function back to a unity object with a recipient script
Make a derivation from Unity's event system overwriting the OnApplicationFocus(bool focus) function (leaving it empty), to fix a sneaky Chrome Android bug.
That's it. The result should look something like in this demo: https://pop.demo.neoludic.games
If you want to save some development time on a feature that really should just be native in Unity, you can also check out my plugin based on the method above. https://neoludic-games.itch.io/pop-input
I also need to enable mobile virtual keyboard for running webgl on mobile device.
I've tried the code from your mentioned url. It gives you some idea on how to do
it, but the code are totally buggy and unusable. Now I am trying to implement it
by myself.

Barcode Scanner add button inside scanning page

I have implemented Barcode Scanner for my Ionic project for both iOS and Android.
But when my Scanner starts, I want to add a button inside the view and add an event to it.
I am using phonegap-plugin-barcodescanner plugin
Please help me with how to append something inside the scanning view.
If you want to add stuff to the layout of your scanner, you need to write code in the plugin itself.
YOU CANNOT INTERACT DIRECTLY WITH THE SCANNER FROM THE JS.
In fact, the plugin you use uses cordova.exec in order to launch the scanner view by passing it arguments.
For Android, you just have to know Java and some XML.
For iOS, you have to know Objective-C / Swift.
For Android, you may have 4 files to modify :
plugin.xml : home of all you dependencies
Your_Activity.java : java file which permits to interact with the scanner view itself by calling buttons, textviews, layouts, etc...
Your_Main.java : java file which gets and returns parameters from the js file of your plugin
Your_Layout.xml : xml file in res/layout which is composed of xml attributes interpreted by java
Beside that, I found two good plug-ins for cordova/ionic apps from GitHub :
phonegap/phonegap-plugin-barcodescanner
tjwoon/csZBar
And there's the expensive one, Scandit, which resolves all of your problems for about 200$ per month, check the pricing for every solution they propose.
If you use their SDK, you may be able to interact with the scanner view from js files because of their work, but they're the only company I know to do that. (perhaps ManateeWorks...)
Under this part is what I've been doing since mid-July, in order to give you ideas.
I'm currently making an ANDROID scanner layout for my ionic app.
You can find my GitHub repository here, I forked it from tjwoon's csZBar and I added some stuff my ionic app needs.
I guarantee nothing, but I'm pretty sure I'll implement an iOS layout soon (at least I'll try), and unfortunately I don't really know android / iOS mobile programming.
Here's a screenshot of the layout
I made a "tab bar" composed of 3 image buttons, a "top bar" composed of text views & image buttons. The scanner is embedded between these two.
There are pop-ups for the app's features, which pause the scanner and respond to click events.
See the README and Java files (csZBar/android/) for more information.
Don't hesitate to ask questions and/or inspect my code.
Warning
1) It's currently on development so use it at your own risks (use branch master, not develop)
2) I only modified the android part, not the iOS!
3) It doesn't work for Windows phone...
After adding plugin, installngCordova with bower install ngCordova
Add link to ng-cordova.js JS file above reference to cordova.js:
index.html
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
Also, don't forget to add ngCordova module:
app.js
angular.module('myApp', ['ngCordova'])
Now you're ready to use the plugin like this:
Controller:
var module = angular.module('starter.controllers', []);
module.controller('BarcodeCtrl', function($scope, $cordovaBarcodeScanner, $ionicPlatform) {
$ionicPlatform.ready(function(){
$scope.scan = function() {
$cordovaBarcodeScanner
.scan()
.then(function(barcodeData) {
alert(JSON.stringify(barcodeData));
}, function(error) {
alert(error);
});
};
});
});
View:
<button ng-click="scan()">Scan</button>

Resetting iPhone Application

I have an application that is currently named "xxxx". The app runs and works perfectly without any problems. However, I have reached a stumbling point. When I try to load the application onto my iPhone, the pictures on my picker view seemed to have disappeared for some strange reason. I've done multiple hours of debugging and everything checks out normal. I then decided I wanted to change the product name from "xxxx" to "xxxx Redo". As soon as I did that, the application loaded perfectly normal (with the pictures in the Picker View as it should be).
In conclusion, it comes to find out that there is no actual bug in the programming aspect of it. However, my question comes up as to why does it not load the correct way with the original product name but then loads the right way when the product name is changed?
The second part of my question is if anyone knows of a way to fix the original application so that way it displays correctly again with the original name?
I have tried the following:
Cleaning the app
Trashing the .app file and rebuilding
Deleting the app on the iPhone and rebuilding.
These things sometimes just happen, you can try the following extra steps:
clean build folder in XCode (press alt while clicking Product menu)
reboot the phone (poweroff/poweron)
I have seen cases where it made a difference.

iPhone Finding AppDelegate

I am trying to create MAC application.
My input is --> Source Code Folder of an existing iPhone Application.
Using my application I want to insert an extra screen in the existing application. The extra screen will be always the first screen.
Since I want to Automate this, I have written a MAC application which browses through the Source code folder and replaces the first screen of app with my extra screen. This is working perfectly for Single View Application where I get the AppDelegate class name from the main.m file ( by parsing UIApplicationMain(argc,argv,MyAppDelegate,nil) ) line.
The application fails when the third argument is 'nil' in some of the applications (which may depend on the implementer or type of project).
Is it possible to make my application generic for all kind of applications?
Regards,
Nirav
Looks like you would only have to search (recursively) the folder for all .h files, and then detect the name of the class that implements UIApplicationDelegate. There should not usually have more than one, and would work with the defaults templates I guess.

PDF doesn't show in UIWebView after Renamed App

I have an App that displays a PDF in a UIWebView that is stored in the App itself.
All working fine! Until I renamed my App. The App started off being called PDFApp, then I changed it to Micro PDF, and again all worked fine.
the client then changed their minds and wanted it to be called "MIC Flooring", but when i do this the PDF does not load in the UIWebView. Very weird! everything else works as expected. If I changed the named back to Micro PDF then it works fine again.
Does anyone know why this may be happening?
Thanks
Sam
I found that you cannot have a space in your Project name - this was making the App not work properly.
instead change the Project Name to be something like - "MyAppName"
and change the 'Bundle display name' in the plist