download manager + google signing
This commit is contained in:
parent
5d38e23b33
commit
1e490a8d0a
13 changed files with 1581 additions and 63 deletions
|
|
@ -0,0 +1,51 @@
|
|||
package btools.routingapp;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
|
||||
/**
|
||||
* Decsription of a service config
|
||||
*/
|
||||
public class ConfigHelper
|
||||
{
|
||||
public static String getBaseDir( Context ctx )
|
||||
{
|
||||
// get base dir from private file
|
||||
InputStream configInput = null;
|
||||
try
|
||||
{
|
||||
configInput = ctx.openFileInput( "config.dat" );
|
||||
BufferedReader br = new BufferedReader( new InputStreamReader (configInput ) );
|
||||
return br.readLine();
|
||||
}
|
||||
catch( Exception e ) { return null; }
|
||||
finally
|
||||
{
|
||||
if ( configInput != null ) try { configInput.close(); } catch( Exception ee ) {}
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeBaseDir( Context ctx, String baseDir )
|
||||
{
|
||||
BufferedWriter bw = null;
|
||||
try
|
||||
{
|
||||
OutputStream configOutput = ctx.openFileOutput( "config.dat", Context.MODE_PRIVATE );
|
||||
bw = new BufferedWriter( new OutputStreamWriter (configOutput ) );
|
||||
bw.write( baseDir );
|
||||
bw.write( '\n' );
|
||||
}
|
||||
catch( Exception e ) {}
|
||||
finally
|
||||
{
|
||||
if ( bw != null ) try { bw.close(); } catch( Exception ee ) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue