Ionic App is not working in android device - android

I have created a app for getting results from OMDB to show ratings. It is working fine in browser when I am using ionic serve and also when I am using ionic cordova emulate browser (For android device). But the issue is when I am converting it to the android app (Via ionic capacitor add android, ionic capacitor copy android) and checking in my android device then it is not working there.
My device has installed latest version of android version with latest MIUI version.
TIA.
I have tried to find the solution but there is no solution found to me for this.
I am using HTTP call for mobile device and HTTPClient call for web browser. I am doing it in my localhost.
I expect that if it is working with cordova emulate browser then it must be working with android device

9 times out of ten this is because you haven't used https for the API feed.
http is disabled on android since a while back, unless you set up special security rules.
The rest of the time it's a CORS issue.

Related

Meteor Android app built on linux does not connect to remote server

I am relatively new to android+meteor+linux development and recently am facing very stange issue which I can not locate which of the 3 above is connected to.
So I have a simple setup where I have 3 EC2 instances on amazon. 1 as a build server(based on parameters it updates one of the web servers), 1 as a development web server and 1 as a release web server. Development and release instances are identical except of the version of the content they hold.
The mobile app itself is built with 2 different machines. Mac for iOS and Linux for Android. Up until recently everything was working as supposed to until a few weeks ago I noticed that Android app does not connect to the remote server anymore. First Meteor status says that it is connecting after which it just switches to waiting.
I realize that the problem can be in many places that is why have tested everything separately until found out that Android app built on Linux and pointing to the development web server particulary does not connect. If I change something in this scenario for example build Android app on Mac or build Android app pointing to release server everything works. I understand that we can just build Android app on Mac as well but it makes me very uneasy that something just stops working out of blue.
So far I know the following:
building server works as supposed to
development web server is working as well(it is accessible through
the web and iOS apps as well as Android app build on Mac machine)
it is not a recent bug(reverting to previous versions does not work)
For the reference:
I have all of the following set up in the project to the correct EC2
instance:
process.env.ROOT_URL
process.env.MOBILE_ROOT_URL
process.env.MOBILE_DDP_URL
process.env.DDP_DEFAULT_CONNECTION_URL
process.env.ROOT_URL_PATH_PREFIX
Neither meteor run nor meteor build seem to produce a working build
on the device.
The following cmd are used:
meteor build ~/[build folder name] --server=[link to EC2 instance
meteor run android-device --mobile-server [link to EC2 instance]
Versions:
Meteor 1.4.2.3
Linux Ubuntu 16.04 LTS 64-bit(all are the same)
Phone Samsung Galaxy s6 edge Android 7.0
Would appreciate any input if anyone has any idea what that behaviour could be caused by.

Set config.xml in Cordova to allow internet access

I am using Visual Studio 2015 Community version.
I am creating app using Cordova for android mobiles that need an internet connection during access the app.
Everything running fine when I run my app in computer / laptop android emulator but when I install my app in mobile by running that app it disconnect the internet connection and without that my app can't run.
what to do?
I have came across these solutions but no one helps me to solve this problem.
Link 1
Link 2
Link 3
Link 4

Ajax call fails in Intel XDK hybrid mobile App - live deployment

I am fighting a big problem here for 2 days. I have created a hybrid mobile app in Intel XDK. The app makes remote Ajax calls to my server. Everything went fine. Tested in Emulator and everything went fine. Also tested in App preview by connecting my Android device to my MAC - this also went fine.
Now, it was time to build and generate the APK file. After I installed the APK in my Android device, all the Ajax calls have failed. It simply shows blank.
I then checked some forums and have also made "Access-Control-Allow-Origin: *" in my server. Even this did not help. My Ajax calls are not responding or is being blocked - I don’t know.
I am using the latest version of Intel XDK. I have also included both the intelxdk.js and xhr.js within the HEAD tag.
USB Debugging is fine and works. But, I have no idea how to debug this live deployment. What else can I try.
Any help would be highly appreciated.
There is a known ajax issue with apk built with latest Intel XDK on Android > 4.4, this is due to the version of Cordova CLI 4.1.2.
In the Intel XDK -> project settings -> build settings for Android, change the Cordova CLI version from 4.1.2 to 3.5 and ajax should work again. We are working on a fix when using latest CLI
Also u dont need intelxdk.js and xhr.js if you are building Cordova builds.

How to test Phonegap applications in Eclipse ADT bundle

I have Download the Eclipse ADT Bundle and i am able to Launch the Eclipse and Can see the Option to develop Android Application.Now as I want to Develop PhoneGap Application so have Downloaded that too.Now through the Command Promt i have created a phonegap application Directory successfully.After this i Opened this PhoneGap application Directory folder into the Eclipse .Till here everything is fine . As this is Hello World Application it is working fine in the emulator and I can see the output but as it is very slow and as i do not have any mobile device to connect to the IDE and test the application i googled out and got to know about the Chrome Ripple Which i have installed as Extension in my Chrome Browser.Chrome Ripple is a debugging tool in which we can see the output very fast on the browser itself, no need of any Emulator or Physical Device .
But the problem is that we need to have a localhost server installed into the Eclipse IDE to run the PhoneGap HTML5 pages into a localhost server and then test it on Ripple but i am not seeing any way to add Any server in this eclipse version ..
Please help me how can i add any localhost server into this Eclipse ADT Bundle to test PhoneGap application..
Thanks..
If you have KitKat 4.4+ it is a lot easier to use chrome for debug.
Type un chrome:
chrome://inspect
You can connect to you mobile and inspect html structure and debug without any server.
Other way is to add browser platform in Cordova that is available from last version (4.0). It is intended for debug into browser similar way as ripple mocking all plugins.

Debugging a PhoneGap application

I am new to PhoneGap development and had just picked with the most basic approaches of it.
How can we debug an application developed using PhoneGap. Debugging the application built on phonegap over the browser is easy as we can see the browser console. But things change a lot when the same application is build using phonegap and packaged in the APK file.
I tried some Android Command Line emulator apps, but was not successful to see the logs.
While developing the android application I had used log.v and in phonegap I am using console.log.
How can I see the logs I am making in the application. Is there any way to get the logs for the application built by Phonegap.?
Debugging phonegap is nothing but debugging JS. we had a tough time doing so. but Weinre was very helpful for our (partially) purpose. just install weinre and have the code injected to your device index.html. now you can get what is happening through the device console in the webinspector. hope this helps you...
If you are starting with phonegap you should read this link:
http://cordova.apache.org/docs/en/3.5.0/guide_next_index.md.html#Next%20Steps
It include a lot of useful information about phonegap programming, debugging, etc.
Debugging
Debugging Cordova requires some setup. Unlike a desktop application,
you can't simply open dev tools on your mobile device and start
debugging, luckily there are some great alternatives. Safari Remote
Debugging
The first option is Safari Remote Debugging. This works only on OSX
and only with iOS 6 (and higher). It uses Safari to connect to your
device (or the simulator) and will connect the browser's dev tools to
the Cordova application. You get what you expect from dev tools - DOM
inspection/manipulation, a JavaScript debugger, network inspection,
the console, and more. For more details, see this excellent blog post:
http://moduscreate.com/enable-remote-web-inspector-in-ios-6/
Chrome Remote Debugging
Virtually the same as the Safari version, this works with Android only
but can be used from any desktop operating system. It requires a
minimum of Android 4.4 (KitKat), minimum API level of 19, and Chrome
30+ (on the desktop). Once connected, you get the same Chrome Dev
Tools experience for your mobile applications as you do with your
desktop applications. Even better, the Chrome Dev Tools have a mirror
option that shows your app running on the mobile device. This is more
than just a view - you can scroll and click from dev tools and it
updates on the mobile device. More details on Chrome Remote Debugging
may be found here:
https://developers.google.com/chrome/mobile/docs/debugging
It is possible to use Chrome Dev Tools to inspect iOS apps, through a
WebKit proxy: https://github.com/google/ios-webkit-debug-proxy/
Ripple
Ripple is a desktop based emulator for Cordova projects. Essentially
it lets you run a Cordova application in your desktop application and
fake various Cordova features. For example, it lets you simulate the
accelerometer to test shake events. It fakes the camera API by letting
you select a picture from your hard drive. Ripple lets you focus more
on your custom code rather than worrying about Cordova plugins. You
can find out more about Ripple here:
http://ripple.incubator.apache.org/
Weinre
Weinre creates a local server that can host a remote debug client for
your Cordova applications. After you've installed and started it up,
you copy a line of code into your Cordova application and then restart
it. You can then open a dev tool panel on your desktop to work with
the application. Weinre is not quite as fancy as Chrome and Safari
Remote debugging but has the benefit of working with a much greater
range of operating systems and platforms. More information may be
found here: http://people.apache.org/~pmuellr/weinre/docs/latest/
Other Options
BlackBerry 10 supports debugging as well: Documentation
You can debug using Firefox App Manager as well, see this blog post and this MDN article.
For more examples and explanation of the above debugging tips, see:
http://developer.telerik.com/featured/a-concise-guide-to-remote-debugging-on-ios-android-and-windows-phone/
In Android you can debug your app in eclipse logcat where all javascript and other errors will be shown in console.
But for ios you need to install phonegap console plugin to see errors. install below plugin from url.
https://github.com/apache/cordova-plugin-console
Hope this helps..
Thanks

Categories

Resources