Skip to content

Commit

Permalink
Merge pull request #1 from copyninja/master.
Browse files Browse the repository at this point in the history
- Ant build script added
- Language support for kannada, tamil and bengali
  • Loading branch information
rajivnair committed May 2, 2011
2 parents 6ffc581 + e1fbe4a commit c99bfc3
Show file tree
Hide file tree
Showing 28 changed files with 160 additions and 106 deletions.
16 changes: 16 additions & 0 deletions .gitignore
@@ -0,0 +1,16 @@
# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties
Binary file added Indic_Dictionary.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion Silpa Dictionary/AndroidManifest.xml
Expand Up @@ -15,4 +15,4 @@
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
</manifest>
</manifest>
Binary file removed Silpa Dictionary/bin/Silpa Dictionary.apk
Binary file not shown.
Binary file removed Silpa Dictionary/bin/classes.dex
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$array.class
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$attr.class
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$color.class
Binary file not shown.
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$id.class
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$layout.class
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$menu.class
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R$string.class
Binary file not shown.
Binary file removed Silpa Dictionary/bin/org/smc/silpa/dict/R.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Silpa Dictionary/bin/resources.ap_
Binary file not shown.
1 change: 1 addition & 0 deletions Silpa Dictionary/build.properties
@@ -0,0 +1 @@
target=android-3
84 changes: 84 additions & 0 deletions Silpa Dictionary/build.xml
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="Silpa Dictionary" default="help">

<!-- The local.properties file is created and updated by the 'android'
tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />

<!-- The build.properties file can be created by you and is never touched
by the 'android' tool. This is the place to change some of the
default property values used by the Ant rules.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="build.properties" />

<!-- The default.properties file is created and updated by the 'android'
tool, as well as ADT.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<property file="default.properties" />

<!-- Custom Android task to deal with the project target, and import the
proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
</path>

<taskdef name="setup"
classname="com.android.ant.SetupTask"
classpathref="android.antlibs" />

<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
[This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir}]
<target name="-post-compile">
</target>
-->


<!-- Execute the Android Setup task that will setup some properties
specific to the target, and import the build rules files.
The rules file is imported from
<SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<setup> task.
- customize it to your needs.
- Customize the whole script.
- copy/paste the content of the rules files (minus the top node)
into this file, *after* the <setup> task
- disable the import of the rules by changing the setup task
below to <setup import="false" />.
- customize to your needs.
-->
<setup />

</project>
2 changes: 1 addition & 1 deletion Silpa Dictionary/default.properties
Expand Up @@ -8,4 +8,4 @@
# project structure.

# Project target.
target=android-8
target=android-6
59 changes: 0 additions & 59 deletions Silpa Dictionary/gen/org/smc/silpa/dict/R.java

This file was deleted.

85 changes: 45 additions & 40 deletions Silpa Dictionary/res/layout/main.xml
@@ -1,41 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/all_white"
>
<EditText
android:id="@+id/entry"
android:layout_width="fill_parent"
android:layout_height="70px"
android:background="@android:drawable/editbox_background"
/>
<Spinner
android:id="@+id/lang"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry"
/>
<Button
android:id="@+id/ok"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_below="@id/lang"
android:text="OK" />
<Button
android:id="@+id/clear"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/ok"
android:layout_alignTop="@id/ok"
android:text="Clear" />

<ImageView
android:id="@+id/result"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ok"
android:paddingTop="10dip"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
<ScrollView android:fillViewport="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:focusable="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/all_white">
<EditText
android:id="@+id/entry"
android:layout_width="fill_parent"
android:layout_height="70px"
android:background="@android:drawable/editbox_background"
/>
<Spinner
android:id="@+id/lang"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/entry"
/>
<Button
android:id="@+id/ok"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_below="@id/lang"
android:text="OK" />
<Button
android:id="@+id/clear"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/ok"
android:layout_alignTop="@id/ok"
android:text="Clear" />
<ImageView
android:id="@+id/result"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="10dip"
android:scaleType="matrix"
android:layout_below="@id/ok"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
</ScrollView>
6 changes: 3 additions & 3 deletions Silpa Dictionary/res/values/strings.xml
Expand Up @@ -10,12 +10,12 @@
<string-array name="lang_array">
<item>Malayalam</item>
<item>Hindi</item>
<!-- <item>Telugu</item>
<!-- <item>Telugu</item>-->
<item>Tamil</item>
<item>Kannada</item>
<item>Oriya</item>
<!-- <item>Oriya</item> -->
<item>Bengali</item>
<item>Gujarati</item> -->
<!-- <item>Gujarati</item> -->
</string-array>
<color name="all_white">#EEEEEE</color>
</resources>
11 changes: 9 additions & 2 deletions Silpa Dictionary/src/org/smc/silpa/dict/ImageDownloader.java
Expand Up @@ -21,8 +21,15 @@ public class ImageDownloader {

public void download(String word, String lang, ImageView imageView) {


String url = "http://silpa.org.in/Dictionary?image=y&text=" + word + "&dict=" + lang + "&imagewidth=400&imageheight=400&fontsize=22";
String method = null;
if(lang.equals("en-ml") || lang.equals("en-hi")){
// Normal Image method getimage_def
method = "y";
}else {
// Call wiktionary related method get_wiktionary_image_def
method = "w";
}
String url = "http://silpa.org.in/Dictionary?image="+method+"&text=" + word + "&dict=" + lang + "&imagewidth=0&imageheight=0&fontsize=18";


BitmapDownloaderTask task = new BitmapDownloaderTask(imageView);
Expand Down

0 comments on commit c99bfc3

Please sign in to comment.