How to select images for iOS device library using DETOX? - detox

How to select images for iOS device library using DETOX ?

Unfortunately this is something that the Detox are unable to implement. LeoNatan at Detox explains:
UIImagePickerController runs in a different process, thus we cannot control it
Your best bet is to mock the image picker API to just return some default image.
A quick search also turned up this post E2E: Select an image from a UIImagePickerController with Wix Detox, which as some work arounds that may work for iOS 9 and 10, but it is noted that from iOS 11 and onwards the UIImagePickerController is in a separate process and it cannot be accessed. Again mocking the API seems to be the general consensus.

Related

How To add Focus, Brightness and Zoom controls to react native camera?

I used react-native-camera on my iOS app and now trying to add Focus, Brightness and Zoom controls to it. So far I was unable to come up with a solution. Any idea how to do this?
I tried to find an option in different react native camera packages. Also posted in their git repos for help. Finally tried this post: https://medium.com/react-native-development/react-native-camera-app-with-live-preview-saturation-and-brightness-filters-d34535cc6d14 Where they take a photo from the camera every 5 milliseconds and adjust its brightness which seems to be very unstable and it makes the app crash.
It is not possible to use the focus and zoom functionalities with react-native-camera.
Unluckily the focus api has many bugs and the zoom functionalities will not render fast enough with javascript.
Maybe a solution is not using react-native-camera and instead just writing an intent to open the default camera application
The following app uses this solution, all the camera functionalities work perfectly.
Could they re-open the issue as it seems to not be solved?
Developers may need to review all the open issues to estimate the project deadlines.

How to deal with the ios Launch files

It has been a while since I created my last app and I missed the change with the launch file (since titanium 5.2.0).
I want my app to have a custom splashscreen (full screen image). In the past I used the various png files for the splashscreens Default.png, Default#2x.png etc.
I'm testing with the launch file and the custom Storyboard. At the moment it's not clear to me how I can achieve the behavior i want: A full screen image in the splash screen.
What is the best approach?
Thanks for the help.
Go to http://docs.appcelerator.com/platform/latest/#!/guide/Icons_and_Splash_Screens-section-29004897_IconsandSplashScreens-iOSgraphicassetrequirementsandoptions and take a look at the Purpose column. You'll see 9 splash screen sizes. You have to make each of them and put them in app/assets/iphone. Note that you have to name them exactly as told in the table.
This worked for me, Ti-5.4.0 tested on iPhone 7, iPad Air, iPhone 4S and iPhone 6S Plus.
Since version 5.2 storyboards were introduced. You can use them or you can disable it and use the "old" method to implement splashscreens.
To disable it, add this to tiapp: (of course, within the existing ios section in tiapp
<ios>
<enable-launch-screen-storyboard>false</enable-launch-screen-storyboard>
</ios>
To use it, look at the documentation how to implement it correctly.

Display App in 3.5" Resolution on iPhone 5 for Development/Debugging

Does anyone know if there is a way to force an app you're developing to run in a 3.5" screen size mode if you're on an iPhone 5, just for dev/debug purposes? Something such as what might look like a toggle in the Development section of Settings or something. In other words, run the app such that it LOOKS like it's running on a non-5 iPhone (black bars on top/bottom), that way I can test certain UI functions.
For clarification, I'm NOT saying "I don't want to support iPhone 5" - I most certainly do. Also, I'm aware that I can do the 'old' retina display in the simulator, but I do not want to use the iOS Simulator as the app includes libraries that do not support i386 architecture, uses push notifications, and heavily relies on GPS to function correctly. I'm just looking for a way to test both aspect ratios on the same device to save money/time.
Thank you!
It appears that by removing the app from device, deleting the Default-568h#2x.png launch image, cleaning the project, and re-running app, I can get the functionality I'm looking for, although not as nicely as a toggle switch.
Letter box in iPhone5

Managing an iOS app across different platforms

I have an iOS 5.0 app presently and had a few questions regarding deploying the app across multiple platform and multiple OS upgrades. I would like to know if there is a clean and configurable system that allows me to have one project handle deployment to the iPhone iOS5 and iOS6 and the latest iPad iOS without having ugly selection statements everywhere determining the platform the app is being currently run on. So I would like to know if there is a way to manage the code from a dev prespective so i can support all version/platform specific features of my app depending on what platform/version it is being currently run on (for ex. automatically switching to use the longer dimension background images if the app is being run on an iPhone 5 with iOS 6)
Is there any way to have this functionality?
I am slightly confused with your question, but I'll explain what I know. Xcode already has a way to change your app depending on what Device/iOS Version the user is running. If you use storyboards, then it will automatically resize your app content depending on whether the screen has retina support, and the size of the screen. In addition, you can have a storyboard for iPad, so that when you run the app it will use the iPad version. It also will change the app icons. Just go to the project settings and scroll down until your get to the icons and lunch images.
Now, if you mean you want to change how your app works using the source code directly, then there is no easy to way to manage it. Your best bet is to go with Storyboards, as it makes it very easy to resize content depending on what device your using.

How to convert iphone application to Android using Titanium?

I have implemented iphone application using Titanium..But I want to convert in to android application.
Is it possible doing small chnges?
There are changes, but not major changes. Here is what i would do in my case?
Understand How iPhone works and Android works. Compare them in terms
of working model and OS Architecture. This will purely give you more idea on how to make an real Android App... else you would end up cloning your iPhone feel to Android again.
List out all the components i have used in iPhone and check out the
similar component available for me to replace. { For instance,
TableView has a delete option for iPhone and not for Android }
I would remove the back button implemented in iPhone and check how i
can move between windows with the Android BackKey.
Styles and Animation i have used in iPhone will not be the same for
Android. I think they don't have full supported ones too.
For example: style:Titanium.UI.iPhone.ActivityIndicatorStyle.BIG,
maybe you experience some performance differences depending on your implementation since the javascript engine is not the same. if so, you maybe need to restructure your app to ensure a performance enhancement.