So whenever I add
<uses-sdk android:minSdkVersion = "7"></uses-sdk>
my application refuses to work properly. The UI is miniature (the font is small and the buttons are smaller than usual). I tried changing the minversion from 7-15 and none of them worked. My phone is on 4.0.4 and whenever I take out
<uses-sdk android:minSdkVersion>
it works perfectly. Sadly google market requires this, and I can't upload the application not working. Any ideas? If I need to give more information just ask, thank you so much!
The application is mainly an XML app, such that there is no graphical interface, just native buttons, and such. I am using the Theme.Holo.Light theme though. Thank you!
The easy fix is likely to set minSdkVersion to 1; this should give you the same behavior as leaving it out, but allow you to upload your app to the Play store.
The better solution would be to set it to an appropriate value based on what APIs you use and testing it on various devices, and adjust your layouts to work appropriately.
Related
We developed an application in IOS using 'apple-system-font' and we loved this font so we want to use the same font for all TextViews in the android application.
So Is there any way to use 'apple-system-font' in the android application like the following:
<TextView
...
android:fontFamily="-apple-system-font" />
Latest iOS uses 'Helvetica Neue' as system font. You need to download the font file and then add it in your assets. This process is explained in this StackOverflow question.
Note that Apple may choose to change this font over time. Also, even though the font is highly legible and crisp, the users on an Android device may not be used to seeing it. this may result in a 'different' experience for them. Make sure you do proper user testing before adding the feature in production app.
I'm having a bizarre transparency issue with my app on Android Lollipop (and only Android Lollipop).
Steps:
Uninstall any previous versions of my app.
Install the app.
Notice weird transparency on some fragments in my app (full-screen dialog, a fragment we slide in, our pull-to-refresh code).
Build a new binary with no code changes and install on the phone as an update.
Fragments all look fine.
Steps 1-3 I understand -- maybe some material theme is being applied inconsistently, or there's an issue with the custom themes we use in our app.
But I don't understand why re-deploying to the phone fixes the problem.
I'm seeing this on an unmodified Nexus 5 that got the Lollipop update over the air. I see the same issue on the Lollipop emulator.
I've tried changing our targetSdk from 19 to 21 and it did not help. minSdk remains at 15.
Has anyone seen an issue like this and can hopefully point me in a direction to debug?
Edit: Clearing data causes the transparency to return. Force-stopping the app and restarting it fixes the transparency issue. So I think cybersam is on the right track with his answer below -- there's some kind of issue in bootstrapping. But the fragments in question use #android/color:black and #color/my_app_black (= #FF000000) as their background colors, so I don't think the issue is in my app-specific code.
There is not enough information to say for sure what is going on, but I can see one scenario that can cause this. It may be totally unrelated to your situation, but here it is, anyway:
(1) You normally depend on persistent data (e.g., stored in shared preferences, DBs, files, etc.) to determine how to display your background, and have a bug where you: (a) look for the persistent data, (b) see it's not there and use an inappropriate default value (e.g., null) instead, and (c) go on to display strange backgrounds due to the bad default value.
(2) However, you also have special code that detects the missing persistent data and initializes it with appropriate values. But that special code has a bug in that it does not update your in-memory state to match the stored values.
With the above situation, during a fresh install (and as long as the app is not killed by the system and then re-started), you would continue to use the bad data and see the bad backgrounds. During a re-installation (where you did not uninstall the app first), the system would kill your app and then re-install it without deleting its persistent data. Therefore, on a re-installation, bug (1) would not be hit and you would see the expected backgrounds.
Not really an answer, but adding a values-v21 and changing my black color to #010101 works fine. I have no idea what the issue is. Seems like an obscure theme misuse or an obscure platform bug.
I need to crop an image using selectors and dragging etc.
I cannot use com.android.camera.action.CROP cause in many phones i tested doesn't work.
I searched here all examples, the only working is that where is used android.provider.MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI
but the problem is that everytime it asks user to choice the image.
Can someone post me kindly an example.
I need to open it on the image i need, without that the user has to open an image, searching in file system.
I am enough disappointed cause android doestn offer something compatible for all devices from 2.1 android till 4 at least...
Thanks
Download Sample:- https://github.com/lorensiuswlt/AndroidImageCrop
Only three changes required for android 2.1:-
In main.xml, write wrap_content instead of matchparent.
In AndroidManifest.xml, <uses-sdk android:minSdkVersion="7" />
In default.properties, target=android-7
A project is a best tutor.
I've written a relatively simple app, and I've been testing it out on the various different API levels created through the SDK and AVD manager in Eclipse. It works great in all API levels except for level 3. I have a few spinners on the front page which work just fine, but my four buttons don't seem to be working. I've tried adding a breakpoint in one of the 'onClick' methods that I specified in my xml layout file, but the breakpoint never seems to get reached. I'm kind of at a loss here. Does anyone have any idea what could be going on here?
Level 3 does not support the onClick attribute in XML. Unfortunately, you'll have to wire up OnClickListeners in code.
... or drop support for 1.5. It's a small and shrinking part of the market.
My goal is to modify the Launcher application and dynamically modify and change the theme.
I saw several 'home' apps at http://www.cyrket.com/p/android/com.stain46.taghome/. It looks like they took the default Home(Launcher) and modified it. How did they do that? What do I need to modify to achieve the same thing?
I have done this with the ICS launcher. You also need to do quite a number of code changes to get it to compile as a normal app because it uses a lot of private internal APIs (despite what Google may have implied). You also need to change the package name. There are two limitations I've found:
There's a filter called TableMaskFilter that isn't available to normal apps. I think this allows the app drawer to be semi-transparent, but I removed uses of it and it looks fine I think.
More critically, it appears there is no way to replicate the widget-adding experience because it requires a permission that only system apps can have. See this question.
Anyway, I put my source here. It compiles and works on the official Galaxy S2 4.0.3, but if you try to add widgets it will crash.
Note, when you're changing the package name, there are places that Eclipse's refactor doesn't notice (e.g. XML layouts). I recommend you do a global text search/replace instead.
The standard Launcher is open source so you can definitely grab it and modify it the way you want. For your app to be used as the Home Screen you will need to specify the correct Intent filter in your AndroidManifest.xml and the user will have to choose your app when they press the Home button. Why don't you grab that code, play with it and come back when you have more questions and more of an idea of what you want to change.
Here i found one stable version Launcher2
I have sharing that GitHub repo. HERE
WIKI of this project :
This project contains the code for the Launcher app that ships with Android Jelly Bean (API 16).
Some minor changes were required from this source code to remove the use of private APIs. These changes have been marked by "// AOSP Change"