would someone provide me with the code to read an epub book and display as webView , I have tried my best to get the needed code but never got it so i wish if someone would post it for me, I need a step by step procedure as i am a beginner i am using eclipse thanks in advance
You can try CoolReader here, and FBReader here.
1.epub (non-DRM), fb2, txt, rtf, html, chm, tcr, doc, pdb formats supported
2.Pages or scroll view
3.Table of contents
4.Bookmarks
5.Text search
6.Hyphenation dictionaries
7.Most complete FB2 format support: styles, tables, footnotes
8.Additional fonts support (.ttf)
9.Can read books from zip archives
10.Automatic reformatting of .txt files (autodetect headings etc.)
11.Styles can be customised in wide range using external CSS
Android specific
Page flipping animation.
Built-in file browser, quick recent books access
Day and night profiles (two sets of colors, background, backlight levels)
Brightness adjustments by flick on left edge of screen
Background texture (stretched or tiled) or solid color
Paperbook-like page turning animation or "sliding page" animation
Dictionary support (ColorDict, Fora Dictionary, Aard dictionary)
Customizable tap zone and key actions
Place additional textures to /sdcard/.cr3/textures/ -- to be used as tiled page backgrounds
Place additional textures to /sdcard/.cr3/backgrounds/ -- to be used as stretched page backgrounds (/cr3/ directory can also be used instead of /.cr3/, and internal SD or internal storage instead of /sdcard/)
TTS (text-to-speech) support
Select text using double tap (optional)
Related
Do we have some clear guide on how to generate pdf in android which includes tabular data too, with custom fonts like devnagri etc? I have tried itext pdf but text other than English shows blank. Any free or paid library will be helpful.
If you can draw it on screen then you can draw it to a pdf with the built in PdfDocument Class as you can use any laid out view (either got from what is already on screen or manually laying it out yourself) and then use the View's draw method to draw it to the PDF.
So for the tabular data you can use a TableLayout or other methods and the standard fonts available to your app.
Note the Pdf is a bitmap of the contents (e.g. the text is not editable)
I want to build a digital clock widget for Android, and I have written the numbers from 1 to 10 on paper and scanned them, so that I now have the numbers as per images with transparent background. I may have missed it but I can't really see if in the documentation anything about using images as numbers. Would i be better off creating a font even though it would only consist of the numbers?
First off: add each image separately to the res/drawable directory and reference them from there.
An Opengl surface could render them or, more easily I think, an ImageView with programmatic image flipping.
I'm working on the same thing. Any idea how to run an onTick()-like function for currentTimeMillis()? That would be the path to victory on when to render the next second on your clock face.
My Android application have to show an image include 16 parts that download from server (for example the human
body), the user can touch some specific part of this image (for
example the head or the stomach) and this part have to be highlight in
some way (for example by displaying a dark - transparent layer around the image so
the highlight image can see clearly )
So how can I highlight an image when still loading the other images .
And can I support it from 2.1OS .
Thanks in advance !
Sorry for my poor english !
If your big image exists from smaller pics, Java has a class named MosaicDescriptor
The "Mosaic" operation creates a mosaic of two or more source images. This operation could be used for example to assemble a set of overlapping geospatially rectified images into a contiguous image. It could also be used to create a montage of photographs such as a panorama.
All source images are assumed to have been geometrically mapped into a common coordinate space. The origin (minX, minY) of each image is therefore taken to represent the location of the respective image in the common coordinate system of the source images. This coordinate space will also be that of the destination image.
Detail and reference
I've build an Android APP with offline map data using Openstreetmaps and OsmDroid. On a device with MDPI 320x480 pixels the map looks OK, but on a device with a HDPI screen with 480x800 pixels the street names are small and a little bit harder to read them. My map data till zoom level 18, the maximum I could download and use with Mapnik tile source, is loaded as a zip-file from the SD-Card. My local maps are from a defined region of Brussels (Belgium).
A screenshot of an MDPI device with 320x480 pixels:
A screenshot of an HDPI device with 480x800 pixels:
If you see these views in the app on the device the MDPI map is good readable, in the HDPI map the street names are smaller.
Is there a way to make the street names also more readable on the HDPI device, so the user haves the idea that he zooms one step further on the map? Because it's not possible to go to zoom-level 19, because there is no openstreetmaps data for it. So a little workaround solution with easy and small implementation time/work my be OK for me. Zooming is now done by swiping on the map. If you also need the code, let me know and I'll post it.
Thanks in advance.
Kr
Osmdroid works with tiles that are static PNG images. You can not change the tile images. If you want to have a better mapping solution try MapsForge. This app/library works with maps data and renders them dynamically. This way you have more control on rendering maps and you can customize its texts and fonts and colors.
In this answer I will explain a little bit how I changed the size of the street names.
In the jar file of MapsForge there is a xml-file included that will standard be used for rendering the map data. You can download this file also by checking out the source code from the server: http://mapsforge.googlecode.com or download the xml-file itself from here: http://mapsforge.googlecode.com/svn/trunk/mapsforge-render-theme/src/main/resources/osmarender/osmarender.xml. So, you have a basic to tweak your own render file. I tweeked it a little bit like this:
(snippet of the xml-file):
On the Wiki-page of the MapsForgeRenderThemeAPI page (on the site above) you can find how to tweak your own render file and what e, k, v attributes in the rule element means. As you can see there is a rule element with e="way", k="area", v="~|no|false" inside the no-tunnel way rule-element somewhere under the way rule-element. Every rule-element under this element haves
an e="way", k="highway" and v value equal to the openstreetmap parameters. As you login to the edit page on openstreetmap.org you can find out the kind of streets you want to tweak the names for.
Now I gonna tell how you can exactle the font-size you want for a specified type of street. As an example I will take the tertiary road element. Each kind of way rule-element contains some code like this:
<rule e="way" k="highway" v="tertiary">
<line stroke="#ffff90" stroke-width="1.5" />
<rule e="way" k="*" v="*" zoom-min="14">
<pathText k="name" font-style="bold" font-size="32" stroke="#ffff90" stroke-width="2.0" />
</rule>
</rule>
The line element specifies how the street will be displayed (color, width, black border, ...).
There is again a rule-element inside here containing a pathText element. This element specifies how the text will be displayed inside the stroke(color, width, font-size, ...). So, this is the element we need! In my example, as you can see, the font-size for the street names for a tertiary road will be displayed with a size of 32 pixels for a zoom-in-level of 14 or higher.
Now we want to use our own render theme xml file:
I've added my own render-xml file in the assets folder of my project. Than a t launch time, I copy the file to a location from where I can read it out when it is needed. In the activity where you handle your mapsforge map you only have to link to this file by implementing code like this (example):
File f = new File(Environment.getExternalStorageDirectory(), myRenderTheme.xml);
mapView.setRenderTheme(f);
Note that setRenderTheme(File) will throw a FileNotFoundException.
So, this is all for changing the street names with mapsforge. You can render you're whole map as you want!
Thanks to the MapsForge development community.
Have fun!
Kr
I wonder how whatsapp gives support for that. I could use emojis on iPhone because it is natively supported. I'm not developing for bb neither android but I need to help a coder with this stuff.
The bb guy told me that he can add a font as a project resource (ttf), but since emojis are colored graphics, I'm not sure if i can create a ttf. I do not know anything about fonts either.
As you can see, my unknowledge is huge on this. I just need some tips that point me to the right way to research.
Thanks!
On Android you can make a BitMap font with the tutorial i found here. Then you can embed all your Emoji into that font.
For making this on the BlackBerry you can use the FontFamily class. Here is a tutorial that explains how this works.
Have fun! :-)
From my experience most emoticons (emoji) do not use a font, but are rather bitmap graphics (e.g. emoticons in the default Android text editor). There are several downsides to using a font:
Suppose you made the characters a, b, c, d etc into emoticons - the user would then be unable to read/send messages with those characters in without them turning to emoticons.
Fonts are generally quite large as they contain a lot of information for displaying the text at different sizes/styles
Using bitmap graphics will allow you to easily use the same emoticons across a wide range of devices, whilst using standard device fonts the text around the emoticons.
You will have to parse the string that you are displaying, find the emoticons, and replace them with images.
On Android for instance you would accomplish this with:
Search the string for all emoticon occurences (regex can do this easily enough)
Replace all emoticons with the string <img src="emoticon.png" /> (althugh change emoticon.png based on the type of emoticon)
Convert the String to HTML with String myHtmlString = Html.fromHtml(myEmoticonString, myImageGetter, null);
Display the string in a TextView myTextView.setText(myHtmlString)
In step 3 myImageGetter needs to be an instance of Html.ImageGetter which returns a graphic (drawable) based on the src attribute of the images in the string (ie it converts a string file name to an actual graphic)
The steps on other platforms would be different but you should be able to use the same basic method (parse string, replace emoticons with images).
Let me tell what I know, I dont know emoji, but googling it had me thinking it is a set of emoticons, primarily Japanese in origin. If that is true I would like to point out that it is common to create custom fonts using a font file (shown here). And in that font file you should be able to embed these emoticons and use them.
The link I provided above, is for J2ME, but the logic and design should be similar. Hope this helps.