Memory Issues in developing Android App - eclipse

I am presently trying to develop an Image Processing based app for android mobiles using Eclipse. My app consists of several buttons and sub-menu buttons as well. I am trying to make it universal(so that it can run on any resolutions) using switch case for the different resolutions, and thereby different resources for different resolutions. The problem is, I am encountering memory overload problems. It runs fine on Xperia U, but not on Galaxy S, and also crashes in the Emulator. I haven't used XMl for my app, and have designed the entire UI programmatically. Please advice me on how to solve this problem. Any help will be highly appreciated. Thanks in advance!

Well, the question sis very general but here are some points that might help:
Designing everything programmatically means your app will be slow and will create everything on runtime. It is not using the design optimization of Android UI by not using XML.
What context are you using in order to create UI objects. If you are tying the UI objects to the apps context rather than activities' context, all the components of UI will remain in memory unless the app is killed. Unlike in activity as soon as the activity is destroyed all its UI components are killed.
You could use XMl inflator in order to reduce work in Java, by reusing components created in XML . This will help you optimize some sub components that you are using repetitively.

Related

Hololens Methods of Input and Output

I have planned to start building an application for the Hololens in a month from now. So right now, I am just in the preliminary design and feasibility check. (For the record I have built simple applications for the Hololens using Unity and also have used the camera for some image recognition)
My main concern is methods of inputing data to my application. In a normal application you have GUI widgets such as spinners or sliders, if you want to enter a numberic number.
How can I input numeric values to a Hololens application?
Since you've made a few applications for HoloLens before I'm guessing you know about the MixedRealityToolkit That Microsoft offers. If you don't know about it yet, and want to use it, here is a quick guide for how to set it up (which can also be found on the MixedRealityToolkit Github). In this toolkit there are a lot of tools that can help you with building the interactions for the HoloLens.
In this toolkit there are also a few examples on how to go about making sliders and other sorts of input.
If you look under Examples/UX you'll see a few scenes/prefabs/scripts that give an example on how you could go about making such GUI widgets for hololens

Building an iOS app with Adobe Flex Builder - Performance Issues

I'm building an app for iOS with Adobe Flex builder and compiling it into an .ipa using Adobe's tools.
Through initial testing, I see that the end result isn't as rich as native code, nor is it as fast or smooth.
Without simply saying 'why dont you just use objective-c', are there any documentation as to the overhead to building an app this way?
Specifically, what kind of performance hit can you expect when using Adobe's platform instead?
Make sure you are using the latest AIR 3.0 SDK for iOS packaging. It is notably higher performance.
Consider best practices when developing your app:
http://www.adobe.com/devnet/flash/articles/optimize_content_ios.html
http://help.adobe.com/en_US/as3/mobile/flashplatform_optimizing_content.pdf
http://www.mikechambers.com/blog/files/presentations/fitc_amsterdam_2010/flash_iphone_fitc_2010.pdf
Blanket comparisons to native Objective-C is a wide topic, to which capability of Flash ubiquitous deployment to multiple platforms should also be considered if you're targeting Android and BlackBerry.
Perhaps citing specific issues of your implementation would help yield insight.
I too have been developing a Flash-based iOS app. My initial prototype was useless in an iPad 1. I had to look for ways to optimize. My second prototype is performing quite well. So here are some pointers.
1) Don't use timers. I had to write my own utility "FrameWorker" Singleton class to manage and delegate all my animations, or even delayed actions to a single enterFrame event. This alone will give you a huge speed boost.
2) Don't use many enterFrame events on different objects. As I said on point one, find a way to use a single enterFrame that you can add and remove processes to.
3) Avoid vectors as much as possible-use images. If you need to draw objects in the Flash IDE or via action script, use cacheAsBitmap = true.
4) Don't use visual objects that are much larger than the screen area. If you need to use large objects across the screen, then manage them off the display list and learn blitting techniques to draw to the screen ONLY the rect that will be display at that time. Lee Brimlow has a couple of good starter tutorials.
5) Be very disciplined about managing events. Make sure you always remove listeners that are not necessary anymore for instance.
6) Distribute your app's load to different frames. Don't do too many intensive things on a single frame.
If you follow these pointers your app will be as fast as any out there.

Multi-Mobile Device Application Architecture

I'm considering building an application for Windows Phone 7, Android, iphone, ipad, and potentially more. Since i'm going to be leveraging a similar look and feel and content, it seems to me like it might be worthwhile to try to create a common base structure that I could reuse across environments.
For instance, i could define the structure of the UI using XML or something, or utilize some common construction of the application which I could build a translator to gen the code in other environments, or even something else. I'm in the very, very beginning stages of thought, and was wondering if anyone has tried this and come up with a good approach? Any ideas?
Thanks.
Beyond simple applications, it not going to happen.
The are a number of problems you will face like:
Different native programming languages on different mobile platforms.
Different UI paradigms on the different mobile platforms.
Very different screen sizes even on the same mobile platform (e.g. iphone vs ipad).
UI Localisation
To really take advantage of each mobile platform, you need to build the UI for that platform to maximise it's UI paradigm. It also matters what screen sizes you want to support, catering for small screen sizes can hamstring you in what you can display in the UI unless you build different screen layout for different screen sizes to give a better UI experience (a lot of work). This can be a big problem on one platform let alone expanding it to other platforms.
For the platforms listed, you can try using mono, but that will only help in the following ways:
One programming language (C#) instead of a different language per platform.
Application engine logic can be shared between platforms.
Native UI per application.
The cons of using mono would be:
You still need to write the UI layer per platform as mono binds to the underlying UI api.
Mono runtime overhead in size and sometimes speed.
Mono on the mobile platforms are still new, I have developed one iphone application in monotouch and I found lots of first-release type problems with it.
If you don't mind some of the con's then mono can be a great platform for developing certain levels of applications.
I have found that trying to define a master UI layout just doesn't work in all situations in any application that gets to complex in the information it needs to display to the user. No matter how "complex" you can define the layout, something will break it. You either have to live with a "bad" UI in some cases or have a maintenance overhead.
I like to develop an application for the mobile platform to try can get the most out of that platform and it's features. This may mean that other platform versions of the app may work differently but at least it will feel correct on that platform.
There are some x-platform kits: appcelerator, phonegap, etc. Or you could go the hybrid route and use something like mono as a half measure, then there is the possibility of building a web app with html5.
I wouldn't try to roll my own, that's for sure
Be careful when translating iPad to Android designs. Hopefully this article can help you out:
http://morriscodes.blogspot.com/2012/09/designing-for-android-tablets-vs-ipad.html

iPhone :Can we add more than One application in a Single application

I do have an Idea to integrate with my application. I want to create multiple application within a single one application.
Like
and application containing Weather application as well as image processing application + camera based application.
I want to know Is this thing possible with iphone application?
Please suggest me is this possible with iPhone app development and is it allowed by apple or not.
thanks for your suggestion in advance.
Consider these things as features. Weather information is a feature, image processing is another and camera in another. You can create any number of features in your app. If that is what you have meant by application then that is technically possible and seems also OK with Apple. This is not 3 different applications, rather it's one application with three different features. No matter how many features you have, iOS will treat that as a single application(a single app bundle with a single executable file).
But if are asking whether there is any way to combine separate applications(separate projects, separate app bundles with separate executables) then that is not possible.
Note: Personally I think adding completely different features in a single app is not a good idea.
Go to App Store and search for this app, App Tool Box - All in One. It's exactly the same structure as you mentioned in your post. And it only costs $0.99.
Sure, you can do it. I don't think Apple has anything against an app that does more than one thing. As long as none of those things breaks any of their rules.

What should I consider to ensure seamless port of my iPhone apps to iPad?

Following iPad's announcement and its SDK (iPhone SDK 3.2), porting apps to iPad becomes an important issue. What guidelines I should follow in my iPhone apps to ensure I can port it to iPad as seamlessly as possible?
The different resolution is particularly an important issue. While the iPad runs iPhone apps unmodified, it's not really the desirable behavior for a native app. How can we make our iPhone apps resolution-independent so that they can run gracefully on all resolutions like most desktop apps?
If you've been using IB and setting the resize behaviors of elements properly, and also coding frame coordinates all relative to each other you are half-way to having a UI that can potentially scale to a larger screen.
From the screen shots there are new kinds of action-sheets as well, potentially attached to UI elements instead of floating - if you use overlays today they will probably work about the same but you may want to consider changing placement from the center on larger display.
UPDATE:
Now the event is over, and registered developers can download the SDK - although we cannot talk about specific features here just yet, read through ALL of the documents related to the new OS version as there are a number of things aimed at helping you transition to supporting both platforms. Also before you start using custom libraries for things take a look through the API changes to see what new abilities might be supported that are not today.
Generally speaking, what I said above about IB holds true, and also you should start thinking about how your apps today could use more space to present more information at once instead of being split out over multiple screens. Also if you are doing any projects right now that use images, make sure to initially design the images large enough that you can also use them for higher resolution tablet applications.
It is far more reasonable to expect users to input text (and larger amounts of it) than with a non-iPad device.
Nothing, it appears. Although we don't have the SDK quite yet. It will all existing run iPhone app without an issue, albeit at reduced resolution.
It remains to be seen how much of the existing iPhone SDK is shared with the iPad SDK UI wise.
Judging by what has been said, absolutely nothing. You will have to adapt to the new screen size and better hardware all together, if you want to take advantage of the features that the improved device offers. The lack of a 3g module is also something to consider if your app(s) rely on that functionality.