ADT - Changing an application code and seeing the results instantly - android

I'm currently developing an application for Android, using ADT and a tablet plugged in my computer in USB debug mode. Whenever I change my code I have to "commit", that is re-running the app, so I can see the changes I made. Can be a bit of a bummer. Is there a way to not have to do this? Something like "code-pushing" or similar. After all, this is in debug mode.
Reason I ask this is because I recall watching that documentary about Minecraft, and seeing Notch using debug mode in eclipse and making changes to the game instantly without ever closing or reloading the game.

For Android Java, you could use the layout designer, thought it's probably not what you're looking for (I thought I'd have to mention it). If you're looking for an instant preview, you have to be willing to change your current development environment and language.
Currently, Unity and/or Chaos Project can give you pretty good previews. That's probably what you saw for MineCraft.
There is also HTML/Phone Gap/Cordova that can be previewed on Node.js (either on the browser, or on a Node.js instance on the phone itself).
And there is Android App Inventor, which gives you an awesome real-time preview, but which unfortunately was written in Scheme/LISP, so it can not easily be extended using other languages.
If you're just looking to speed up your save and compile cycle in Java, I'd recommend you switch to Android Studio (instead of Eclipse ADT), and only download updates from Android Studio's Stable Channel. Once properly set up, Android Studio will save you time (however, it still won't give you anything like a real-time preview, but I still highly recommend that IDE).

Related

How to profile a WebGL app using the unity profiler tool?

I am working on a Unity project, and I want to export it on Android, and WebGL. For stability purposes I have to use the profiler provided by Unity, and I managed to make it work with an APK version of my project, running on an Android device. But when I want to export my app on WebGL, it freezes on the first frame, and then stops my web browser.
I checked the checkbox for the profiler to be connected to launch, but nothing seems to be happening on it, and I think it's not working at all...
Have you ever experienced this kind of problem? And how did you manage to solve it?
I have already tried to use the Firefox profiler, but it doesn't work like I was expecting (the Unity profiler is more useful regarding the different processes like GPU CPU Audio etc...)
The version of Unity I am currently using is "Unity_2020.2.4f1"
Can you try running your WebGL version on google chrome?
if you run this app on chrome, you can check the issue on the chrome console.

How to debug when using ARCore?

I'm supposed to make a small AR app for android but since it seems ARCore can't use the computer's camera and Unity Remote isn't compatible with ARCore I have no way of running the app in the unity editor.
Only thing I can do right now is building the app, installing it on my phone, eventually create a canvas where I put some text to see if the app goes where I want it to go. I probably spent half the day debugging simple things because I can't find a way to have access to any console while using the app.
I can run a normal unity app with Unity Remote as long as ARCore isn't used, otherwise, it's just a black screen.
It's for a professional project so I can't just installed plenty of other plugins to make it work that way, I'm limited to ARCore and AR Foundation.

Debug App in Galaxy S5

I am building an Android app for my company, using Android Studio 1.5.1 . I've discovered that the app won't work on some Galaxy S5 phones.
These phones just show a white screen when the app runs.
This error happens on Galaxy S5 devices with Android version 5.1.1 But not on an Galaxy S5 Device running Android version 5.0
I'm focusing on the Android Version as a clue to solving this bug.
I can't actually get one of the devices so I've created several Virtual Devices. There are 6 Downloadable system images of Android 5.1.1 in Android Studio's Virtual Device Configuration wizard. I've installed all of them. none replicate this white screen error.
What else can I do to uncover this bug?
If it helps answer my question, my app relies heavily on server communication. The whole app is just one Webview with a few html & JS files.
The problem with emulators is that they are not reproducing actual device behaviour(especially, once many OEMs like Samsung tend to customise Android based on their needs), so I'm afraid the only options you have are:
Get Samsung Galaxy S5 with 5.1.1
Apart from obvious ideas "go to shop and buy", I can recommend you:
to take a look at Open Device Lab. It operates around the world and there's an arguably good chance to find the device you need there;
build a pool of alpha-beta users you can talk to and share new builds. Google Play has quite rich functionality in this area. Samsung S5 is quite common model, so it shouldn't be a problem to find people with it. If your product is "public", you can try to find beta-users on services like BetaBound or just among your social media network;
Use Analytics tools to collect more data from affected devices and act based on the information you get
There're dozens of different frameworks for accomplishing it. I can suggest Crittercism as a super powerful and comprehensive tool. In particular, I'd definitely log:
All handled exceptions
Add breadcrumbs (short string to capture app run-time information) to all Activity/Fragment lifecycle methods, to Application's methods (as white screen on start might mean some issues there), to all meaningful async tasks, etc.
If app gets into suspicion state - log it as a handled exception, so you can see the whole trail of breadcrumbs and track history of exceptions for the user. Unfortunately, you won't get trail of breadcrumbs, before something has been logged as an issue (crash or exception). There're frameworks, which log everything, like MixPanel, for example, but I honestly think that Crittercism suits much more here)
Crittercism will also catch & report all crashes happen in the app and
The Get Started Guide is here and it's pretty straightforward: http://docs.crittercism.com/android/android.html
Saying that, I'd suggest you to integrate some analytics anyway, as it'll help you in the future and to try to get affected phone in hands for test.
I guess the culprit is webview. Can you check the webview version on which the issue is reproducible.
To check the version you need to go to settings->Application Manager-> Downloaded Apps-> check "Android System Webview"version
We had a similar issue when the screen used to go blank and it used to happen only on particular version of webview. The issue was fixed by Google later.
The chromium webview layer is now updatable from Google Play.
For more details refer-http://developer.android.com/about/versions/lollipop.html#WebView
I assume you are building a hybrid app.
If the webview is the culprit, you could try crosswalk.
It adds Mb's to your app but it makes sure every device uses the same webview (latest chromium). Moreover rendering differences etc are also minimized.
if you are using cordova run: cordova plugin add cordova-plugin-crosswalk-webview and that's it.
If you implement this and the whitescreen problem is gone, you debugged it in a sherlock holmish deduction way...
The problem is not with emulator. It is with WebView in Android versions 5.1 onward.
Try
uninstalling the updates for "Android system webview" app (go to
settings and look for it under "downloaded") it works just fine!
Source - similar question

Is Android + PhoneGap/Cordova always a headache?

I've been developing a mobile app for both iOS and Android. Due to time/budget constraints, we initially selected PhoneGap/Cordova as mobile app framework so we could write once and deploy to both platforms.
This plan has worked fine for iOS, but we're finding that Android's browser/engine is kind-of a piece of garbage (to put it nicely). Every time we add a new feature, we find one more thing that the Android browser doesn't support, or only partially supports, or fully supports but will randomly fail from time to time, etc. Even once we code around the Android issues and get things working smoothly, test it on multiple devices/versions, and deploy a new app to the Android market, we immediately start getting emails and reports from customers who can't get the app to work on their device. We have them uninstall/reinstall, reboot their phone to clear the memory, etc., and their device still consistently fails (and by "fail", I mean it typically just freezes and/or won't respond to touch input - it usually doesn't crash, or anything). The app works fine for most people, but there are still quite a few devices that inexplicably fail.
I don't mean for this to be a rant, I'm trying to analyze whether the Android+PhoneGap path is the correct path for us. Specifically, I'd like to find out the following:
Are there people out there having success with an Android+PhoneGap app? or is Android+PhoneGap always going to be a problem on certain devices?
Am I likely to have more luck with a native Android app (I've never attempted one)? Or are multiple devices/versions always a problem on Android, even with a Native app?
1) Yes. There are are good apps which are based on Phonegap and works well in all devices.
2) It depends on what features of the Android you are going to use. Few versions that does not support some features that's available only to new version.
BTW, what is the minimum required version that you have selected for your app? I assume you are developing the app with Android as base version.
When creating a new Android project, you have to set the minimum required platform version. If you set something higher and use the app in a lower version which does not support the feature, results are going to be different.
After having worked with Android+Cordova for some time now, I have the following suggestions/comments for anyone thinking of going that direction.
Consider using Sencha Touch, or jQuery Mobile, or another mobile framework that has already coded around the Android-browser issues (which there are a LOT of). Consider not straying too far from the default styling that come with those frameworks. Simply styling a normal web page to look like a mobile app is a constant headache to get working on multiple versions of the stock Android browser.
Although the stock Android browser is garbage, Mobile Chrome is pretty nice. In Android 4.4, the Chrome engine becomes the default engine used by a webview of an Android app. If you don't like Sencha or jQuery Mobile or the like, you could hold off and just use a mobile web site for a while until Android 4.3 and below become insignificant. It's not hard to get things working on Mobile Chrome.
Even without Sencha/JQM, you can still muscle your way around the stock browser issues, but it's almost as frustrating as developing for IE6. Okay, maybe not that bad… but close.
I've started experimenting some with a native Android app, and, so far, it seems like less of a headache than building an app with Android+Cordova+lackOfSenchaOrJQMorTheLike. The things I've experimented with work pretty consistently among different Android versions. But I don't have much experience there, so I can't comment too much on a native Android app.

How to use the Android emulator with a screen reader?

There appears to be no accessibility features for the Android emulator. Ideally one would be able to have their computer read the contents of the Android emulation screen to them. From what I've seen, the contents of the Android screen and the buttons that can be used to manipulate the emulation Android etc. are all invisible to a screen reader.
Does anyone know of a workaround for this?
I found what looks like a promising resource here. It's a Text-to-Speech library for Android developed by T. V. Raman of Google. I'm still looking for more information from the community though.
I'm up dating my answer with my experiences. I bought a refurbished first gen Nexus 7 to try and learn Android programming. Installing the Android SDK with the bundled Eclipse was completely accessible. I was also able to enable accessibility on my Nexus 7 with no sited help. Enabling developer settings on the Nexus was also fully accessible. I was able to create an Android project using Eclipse with no problems. I was unable to use the graphical layout editor to add Widgets to a layout, although I was able to edit the XML to create a button with no issues. It looks like layouts are doable, you will just have to reference the docs for proper XML a lot. I created a method to be called when the button was clicked with a for loop so I could test debugging. I debugged the application on my Nexus and set a breakpoint in the body of the for loop. I was able to use standard Eclipse functions to step by line once the breakpoint was hit and view variable values. So far Android accessibility is looking good for the standard Android SDK. I am planning on testing out Android Studio and will update my answer with the results.
A long thread on this can be found at
http://www.freelists.org/post/programmingblind/Is-Android-Programming-Accessible
What I've gathered from it is that accessibility can be enabled with little to no sighted help. When I tried enabling talkback it made the emulator unusably slow although this was over a year ago so maybe things have gotten better? I'm a blind programmer and know Eclipse is accessible with Jaws so he should be able to program with either an IDE or command line and a text editor. I haven't researched this but if the emulator is slow maybe another option would be to run an x86 build of Android in VMWare player? A screen reader written by google employees can be found at
http://google-opensource.blogspot.com/2009/10/talkback-open-source-screenreader-for.html
and one written by someone else can be found at
http://spielproject.info/
One option might be to do debugging on a real phone with accessibility turned on. Debugging works essentially the same (and you don't have to deal with the slowness of the emulator - I much prefer this method because it's so much faster).
It's surely a more expensive option if your friend doesn't already have an android phone.
I think the better question might be "why are the accessibility features missing from the android emulator"? Maybe text-to-speech is too slow on the emulator?

Categories

Resources