• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

The app isn't displaying correctly on my Android phone  RSS feed

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, I'm a newbie here and to the programming world. I am taking a course that focuses on java and learning Android Studio. I'm stuck though, when I check the app on my phone, some words are off screen. Can someone tell me what I am doing wrong?
Capture2.PNG
[Thumbnail for Capture2.PNG]
 
Logan Ray
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guess the second picture didn't show on my original post. Here is what i get when i run the program, after it's displayed on my phone:
Screenshot_2018-01-31-16-03-39.png
[Thumbnail for Screenshot_2018-01-31-16-03-39.png]
 
Saloon Keeper
Posts: 1844
80
Android Chrome IntelliJ IDE Java MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch Logan.

In many places Android uses XML behind the scenes, including (most of the time) for item placement.
There are different types of views like relative view, constraint view etc.

The problem that you are experiencing in your post is that the view(s) are not set correctly.
Without seeing the underlying XML for your project I cannot tell you what exactly is incorrect.
 
Logan Ray
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pete, thanks for the reply. I've heard a lot of good stuff about this place. I worked on a ranch and am hoping to become a programmer so maybe i'll fit in here lol Hopefully this will help figure it out:
Capture3.PNG
[Thumbnail for Capture3.PNG]
 
Pete Letkeman
Saloon Keeper
Posts: 1844
80
Android Chrome IntelliJ IDE Java MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things:
1) Please copy and paste the XML source and use the codetags as noted here https://coderanch.com/wiki/659781/Code-Tags
2) You do not need to use the CardView for these beginning tests/steps. Maybe later on in your app development you will need this control/view, but not right now.
3) The size of the CardView could be an issue, depending on you phone. This is most likely the issue that you are experiencing.
4) I suggest that you go over this tutorial https://developer.android.com/training/constraint-layout/index.html
Here is a basic layout that will work on nearly every device
If you replace what you have with the XML from this post you should be fine.
NOTE: Make sure that you have the correct tools:context value. In this example it is myapplication.MainActivity, but in your it is something else.
This XML is does not have the CardView control in it. Feel free to add it in whenever you want.
I encourage you to edit the XML and change the layout_constraint tags to see what happens.
Right now the text is the center of the screen, but with a few quick edits you can change that.

You should become somewhat familiar with the XML happening behind the scene, or at least aware so that you can make drastic changes to your view with a few edits.
 
Logan Ray
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot for the help. I'll take all this into account and do what you said.
 
Pete Letkeman
Saloon Keeper
Posts: 1844
80
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome and I hope you are able to make some progress with your application development.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!