Hi XDA,
long time since my last posting here. I am trying to teach myself Android developing and recently i published my first android app (it connects to my forum and reads certain data from which are displayed on a map and in lists). My App is based on the Android Studio Navigation Drawer template, which i extended with fragments for the views.
So everything seems fine, but users with old android devices told me, that the burger icon in the left top corner, which triggers the navigation drawer, is missing.
I can reproduce this with my old Huwai MediaPad (CM 11, Android 4.4) but not with my newer devices (Android 5/6). I am getting no errors in the debug view and so i realy have no glue where to start. May this is a typical error? Googling it has no success, but i am also not sure, which code i can give you, to help me.
I have created a new Project, based on the same template. Here the drawer icon is shown also with Android 4.4, so it must be some stupid mistake by me.
Any help or hints would be very helpful, because i do not want to use the "sledgehammer" methode and creating a new projekt and copy line by line into it.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Best regards,
Jacob
In case you haven't solved the problem yet, you should provide more info and piece of code about how you set your navigation drawer icon and whether you are using appcompat or not. check this code and let me know:
Under extends Fragment object
Code:
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
// Sync the toggle state after onRestoreInstanceState has occurred.
mDrawerToggle.syncState();
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
mDrawerToggle.onConfigurationChanged(newConfig);
}
Related
I'm having trouble populating my Spinner, so I'm using the tutorial on Google website,
http://developer.android.com/resources/tutorials/views/hello-spinner.html
When I get to part 4, and I put the code in the the java folder, a bunch of red X's pop up, giving me errors.
My questions is do I delete everything in the oncreate () .jave file and insert the code from Googles site? When I do it give me errors, this is what happens,
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I'm know my coding is wrong, can anybody point me in the right direction?
Hold your mouse over that first "Spinner" that is underlined....I bet you get a hint
You're missing a closing '}' tag at the end, it looks like your missing a spinner called "spinner" in your main.xml and it looks like you've not imported 'Spinner' or 'ArrayAdapter'.
I do have a Spinner in my main.xl, I don't have an arrayadapter though
Ok, I fixed 2 parts of the Spinner issue in the first error line,
I imported a Spinner like Root said, than the second error was it was looking for:
findViewById(R.id.spinner);
Than I realize my spinner is not called 'spinner', it was 'spinner1", so I put the 1 on and the error when away.
Now my next issue is the arrary adapter. I know I don't have one in my main.xml, but based on how far im in the tutorial I havent gotten to the part yet which is #5.
EDIT: It's telling me to "Now create a nested class that implements AdapterView.OnItemSelectedListener. This will provide a callback method that will notify your application when an item has been selected from the Spinner."
Where do I implement that?
Bump, please!
I have an android app.I have a preference in my app which allows a user to enter his desired storage location for video recording it can be internal or external now the question is how can i determine if the user has entered the correct storage location path if he didnt enter the right path then how to show a toast and reset the path.
This is the preference
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This is the editext
Now if the user enters wrong path for example there are spaces in the path or the path is incorrect for video recording how can i check that
Without seeing some code it would be difficult to show you a way that would be easily integrated in to your app.
zalez said:
Without seeing some code it would be difficult to show you a way that would be easily integrated in to your app.
Click to expand...
Click to collapse
Yep, and when is it the "right" path?
The right oath is where a video recording file can be created it can be internal or external
If you've got a file object, you could check these:
Code:
boolean isFile = myFile.isFile();
boolean isDirectory = myFile.isDirectory();
I would implement a chooser instead of relying on your end user to type the correct path.
Take a look at this:
http://www.codeproject.com/Articles/547636/Android-Ready-to-use-simple-directory-chooser-dial
zalez said:
I would implement a chooser instead of relying on your end user to type the correct path.
Take a look at this:
http://www.codeproject.com/Articles/547636/Android-Ready-to-use-simple-directory-chooser-dial
Click to expand...
Click to collapse
Oh, you're right. Much more fool proof. :good:
this is what I am trying to achieve
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
The black rectangle is an image asset which i need to move left and right on related touch events/drags
Being relatively new to Android , I am finding this difficult to implement.
So was hoping I could get some tips,guides,examples if there are any.
I Have tried viewflipper but that is not what I need here, I tried making a slider like a seek bar , but didn't work out.
Some one suggested that I use a framelayout over the main image to slide but I don't know how to do it.
So any help which will help me out here is appreciated
viv_jen said:
Some one suggested that I use a framelayout over the main image to slide but I don't know how to do it.
Click to expand...
Click to collapse
I've got two ideas on how you can accomplish this and I think a FrameLayout would be the simplest solution.
Simple - Using a FrameLayout. A FrameLayout essentially lets you stack views on top of each other. You would have to put two ImageViews in a FrameLayout and set it up so that the black frame is in the overlaying ImageView while the picture in in the bottom ImageView. Here's a nice tutorial on setting that up. Once that's done, you'll have to set an onTouch listener to the overlaying ImageView and move the view as the user drags it. Use this to get started.
Complicated - Create a custom view. You could subclass view and override the onDraw() to render both your picture and the black frame. You would use the same technique of overriding onTouch() to move the frame. Check out the Android Documentation for more info.
You may use this method from Canvas
Code:
public void drawBitmap (Bitmap bitmap, Rect src, RectF dst, Paint paint)
Hi everyone,
I'm very happy to publish my first library project, Dynamic Calendar Icon Generator. This library generates dynamic calendar icons based on the date selected.
This library is fully customizable and the developer can specify the original calendar icon, change font's typeface, size, position, color.
Features
Specify the background empty calendar icon
Change the typeface of both date and month
Change the size of the date and month fonts independently
Provision for saving the generated image to external storage
Supports from API level 9
Change Log
12 Jan 2015: First release
13 Jan 2015: Added support from API 9
Source Code and more details
The source code is available at Github
Screenshots
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sample App
Sample app demonstrating this library is also available in Android play store
To Include in your Android Project
Add the following to your build.gradle file
Code:
dependencies {
...
compile 'com.github.sillebille:dynamic-calendar:1.0.1'
...
}
Contribution
If you like to contribute, you are always welcome. Please send feedback in case if you find any errors or issues.
Any issues or bugs? I'm very eager for feedback/thoughts
Any feedbacks or updates? Any Issues faced recently?
Thanks,
Dinesh
Hello,
I'm in the process of developing a single Android application that runs on multiple different types of devices.
From normal smartphone, tablet to Android TV.
The layouts and styling for each tend to look quite different.
To manually test these applications I can resort to using emulators.
A big downside to emulators is that they tend to take up a lot of valuable resources from the development machine.
Therefor I prefer using real devices. (Ideally just 1 device).
I can use my smartphone to test both the normal layout AND
with the help of the smallest width option in the developer settings I can also test the tablet layout.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
However there is no such option available to spoof/fake Android TV/Google TV on my test smartphone.
AFAIK Android has a kind of prioritisation which layout it tries to inflate.
When it detects a device that has the android.software.leanback feature it will inflate the TV-layout which typically resides in the `layout-television` folder.
Programmatically I check it as such:
Java:
getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK));
// PackageManager.FEATURE_LEANBACK == "android.software.leanback"
Reference documentation https://developer.android.com/reference/android/content/pm/PackageManager#FEATURE_LEANBACK
Since this system feature is missing for normal smartphones it will never work.
You can find the supported features with:
Code:
adb shell pm list features
After some digging I found you can add these system features when you have root access.
They are kept in the /system/etc/permissions folder.
So I simply copy-pasted the `tv_core_hardware.xml` from the Android source code after which I briefly saw my phone render my application in Android TV.
Also the hasSystemFeature(PackageManager.FEATURE_LEANBACK) returned true!
Unfortunately the screens goes completely black after a second or two and reboots in panic mode.
TLDR; How can you force Android TV on a rooted smartphone/tablet?
FYI my rooted test device is an OnePlus 6
Thanks in advance.