Paul Ngom

Ranch Hand
+ Follow
since May 08, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Paul Ngom

I have been trying for the past 2weeks to use loopj to connect and parse JSON data in an activity but each time nothing is displayed. The value of urlJsonObj is correct since it displays the data when i call it from a browser. Where am i doing it wrong?
The code in my activity is as follows:


and some lines of my logcat are:
9 years ago

Why not just adjust based upon the actual width of the screen, rather than guess?

CSS media queries are your best friend here.



Never heard of css media queries. I will find out and see if they can help.

Do these message not have spaces upon which the string will naturally break without all the brouhaha you are planning on going through?


They do but i am talking about line breaks.





You want to break the string to adjust to screen width, correct?


Yes, exactly what i want to achieve.

If that's the case, why does mobile versus not make one bit of difference?


I don't really understand what you mean.

Should you not just be focusing on the available width rather than the device type?


If i don't include the device type, i might not be able to control the display of the string. It may be a long line on some devices.

What are your plans to determine screen width? What's the algorithm you plan to use to determine where to insert breaks?


I can detect that the page call is coming from a mobile phone. So when this is the case, i calculate the width to feed to the div that will contain the string. This width paired with some css properties will cause the string to break automatically.

What are these long unbroken strings in the first place?


They are reply messages.









So what do you want to do? What is your plan to fit the 5 kilos of marbles in the 1-kilo bag?


I cannot imagine how 5kgs of marbles will fit in a 1kg of marble bag! :-)
But to answer your first question, i want to break the string if the screen is big(tablet,pc) and the string length reaches a certain value(please see scriptlet).
I want to do the same if the device calling the page is a mobile phone.






you need to figure out how to break up strings, or apply styles appropriate to how you want to responsively display the data on smaller screens.


I have already thought about that and that is what i do with the scriptlet and the css.




Hi Bear,
Thanks a lot for moving my question to the right forum. I also do appreciate your reply. I added the meta tag but i see no improvement.






First of all, sorry for the scriptlets.
I want to display the content of divStr which will vary in length
depending on user input. I want the sample content
to fit in all screens(mobile phone,tablet,pc). It displays well on pc but
it becomes unreadable on mobile phone. The fonts get too small.
How should i modify the code for the display to come clean on all screens?







Congratulations Bear, Yehuda and Aurelio! Your book will surely come as a relief for those of us who still do form validation with java.






Pushpa,
Are you getting the correct values in sbf?




10 years ago
JSP
I think the final answer is:
select cs.name as source_name,cd.name as destination_name, c.cost from country cs,costs c,country cd where cs.code=c.source and cd.code=c.destination and c.cost=40;

Thanks a lot Roel for the time you spend with me in teachimg me that. I do appreciate it. It is getting to midnight at my side and i am readying to leave you now. Goodbye and i hope to have you another time.




select cs.name as source_name,cd.name as destination_name, c.cost from country_source cs,costs c,country_destination cd where cs.code=c.source and cd.code=c.destination and c.cost=40;

Am i right, Roel?




1) select name as source_name,cost from country_source,costs where country_source.code=costs.source and cost=40;
2) select name as destination_name,cost from country_destination,costs where country_source.code=costs.destination and cost=40;

Then what do i do next if i am correct?






No, I cannot. Any hint? :-)




I may not have understood you question well but if those are the only available 2 table then the query to produce the result you have given could be:

select cs.name as source_cname,cd.name as destination_cname,40 from country_source cs,country_destination cd where cd.code='gh';